Fix
This commit is contained in:
parent
6cc7488bd4
commit
fb1ee6a20a
21
purchase.py
21
purchase.py
|
@ -7,7 +7,8 @@ from trytond.model import fields, ModelView
|
|||
from trytond.pool import PoolMeta, Pool
|
||||
from trytond.pyson import Eval
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wizard import Wizard, StateReport, StateView, Button, StateTransition
|
||||
from trytond.wizard import (
|
||||
Wizard, StateReport, StateView, Button, StateTransition)
|
||||
from trytond.report import Report
|
||||
|
||||
STATES = {
|
||||
|
@ -98,10 +99,7 @@ class PurchaseLine(metaclass=PoolMeta):
|
|||
self.quantity = self.original_qty
|
||||
|
||||
def _get_invoice_line_quantity(self):
|
||||
qty = self.quantity
|
||||
# if self.purchase.invoice_method != 'manual':
|
||||
# qty = super(PurchaseLine, self)._get_invoice_line_quantity()
|
||||
return qty
|
||||
return self.quantity
|
||||
|
||||
|
||||
class PurchaseFarmingStart(ModelView):
|
||||
|
@ -124,7 +122,8 @@ class PurchaseFarmingStart(ModelView):
|
|||
class PurchaseFarming(Wizard):
|
||||
'Purchase Analytic Report'
|
||||
__name__ = 'farming.purchase'
|
||||
start = StateView('farming.purchase.start',
|
||||
start = StateView(
|
||||
'farming.purchase.start',
|
||||
'farming.farming_purchase_start_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Print', 'print_', 'tryton-ok', default=True),
|
||||
|
@ -187,7 +186,8 @@ class GroupingPurchasesStart(ModelView):
|
|||
class GroupingPurchases(Wizard):
|
||||
'Grouping Purchases'
|
||||
__name__ = 'purchase.grouping_purchases'
|
||||
start = StateView('purchase.grouping_purchases.start',
|
||||
start = StateView(
|
||||
'purchase.grouping_purchases.start',
|
||||
'farming.grouping_purchases_start_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Ok', 'accept', 'tryton-ok', default=True),
|
||||
|
@ -255,7 +255,8 @@ class UpdatePurchaseLineStart(ModelView):
|
|||
class UpdatePurchaseLine(Wizard):
|
||||
'Update Purchase Line'
|
||||
__name__ = 'farming.purchase_update_line'
|
||||
start = StateView('farming.purchase_update_line.start',
|
||||
start = StateView(
|
||||
'farming.purchase_update_line.start',
|
||||
'farming.purchase_update_line_start_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Ok', 'accept', 'tryton-ok', default=True),
|
||||
|
@ -269,7 +270,7 @@ class UpdatePurchaseLine(Wizard):
|
|||
print(line.purchase.state, line.purchase.id)
|
||||
if line.purchase.invoices or not self.start.unit_price:
|
||||
return 'end'
|
||||
|
||||
|
||||
elif line.purchase.state == 'done' and not line.purchase.invoices:
|
||||
Purchase = Pool().get('purchase.purchase')
|
||||
_purchase = Table('purchase_purchase')
|
||||
|
@ -289,6 +290,4 @@ class UpdatePurchaseLine(Wizard):
|
|||
where=_line.id == record_id)
|
||||
)
|
||||
line.purchase.save()
|
||||
|
||||
|
||||
return 'end'
|
||||
|
|
Loading…
Reference in New Issue