Merge invoice and credit note
issue5225 review18921002
This commit is contained in:
1 parent
b1adb95a50
commit
ab5d28b374
4 files changed
+7
-8
No files matched your search
@@ -49,7 +49,7 @@ class Asset(Workflow, ModelSQL, ModelView):
|
||||
('product', '=', -1),
|
||||
('product', '=', Eval('product', -1)),
|
||||
),
|
||||
('invoice.type', '=', 'in_invoice'),
|
||||
('invoice.type', '=', 'in'),
|
||||
['OR',
|
||||
('company', '=', Eval('company', -1)),
|
||||
('invoice.company', '=', Eval('company', -1)),
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ class InvoiceLine:
|
||||
states={
|
||||
'invisible': (~Eval('is_assets_depreciable', False)
|
||||
| (Eval('_parent_invoice', {}).get('type',
|
||||
Eval('invoice_type')) != 'out_invoice')),
|
||||
Eval('invoice_type')) != 'out')),
|
||||
},
|
||||
depends=['product', 'is_assets_depreciable'])
|
||||
is_assets_depreciable = fields.Function(fields.Boolean(
|
||||
@@ -41,7 +41,7 @@ class InvoiceLine:
|
||||
else:
|
||||
type_ = self.invoice_type
|
||||
|
||||
if (self.product and type_ in ('in_invoice', 'in_credit_note')
|
||||
if (self.product and type_ == 'in'
|
||||
and self.product.type == 'assets'
|
||||
and self.product.depreciable):
|
||||
self.account = self.product.account_asset_used
|
||||
|
||||
+2
-3
@@ -17,9 +17,8 @@ class PurchaseLine:
|
||||
'an "Account Asset" on product "%s".'),
|
||||
})
|
||||
|
||||
def get_invoice_line(self, invoice_type):
|
||||
invoice_lines = super(PurchaseLine, self).get_invoice_line(
|
||||
invoice_type)
|
||||
def get_invoice_line(self):
|
||||
invoice_lines = super(PurchaseLine, self).get_invoice_line()
|
||||
if (self.product
|
||||
and self.product.type == 'assets'
|
||||
and self.product.depreciable):
|
||||
|
||||
@@ -97,7 +97,7 @@ Buy an asset::
|
||||
|
||||
>>> Invoice = Model.get('account.invoice')
|
||||
>>> InvoiceLine = Model.get('account.invoice.line')
|
||||
>>> supplier_invoice = Invoice(type='in_invoice')
|
||||
>>> supplier_invoice = Invoice(type='in')
|
||||
>>> supplier_invoice.party = supplier
|
||||
>>> invoice_line = InvoiceLine()
|
||||
>>> supplier_invoice.lines.append(invoice_line)
|
||||
@@ -229,7 +229,7 @@ Create Moves for 3 other months::
|
||||
|
||||
Sale the asset::
|
||||
|
||||
>>> customer_invoice = Invoice(type='out_invoice')
|
||||
>>> customer_invoice = Invoice(type='out')
|
||||
>>> customer_invoice.party = customer
|
||||
>>> invoice_line = InvoiceLine()
|
||||
>>> customer_invoice.lines.append(invoice_line)
|
||||
|
||||
Reference in new issue
Block a user