mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
79 lines
2.7 KiB
Diff
79 lines
2.7 KiB
Diff
# exporting patch:
|
|
# HG changeset patch
|
|
# User Cédric Krier <ced@b2ck.com>
|
|
# Date 1417619589 -3600
|
|
# Wed Dec 03 16:13:09 2014 +0100
|
|
# Node ID 78bda42be4643d7e59bf838f229fe689d0fdbf18
|
|
# Parent 288b4d6b861b9e6dafea942bb03e4f8300db8514
|
|
# Add missing company domain/field
|
|
|
|
# issue4311
|
|
# review7691002
|
|
|
|
diff -r 288b4d6b861b -r 78bda42be464 asset.py
|
|
--- .a/trytond/trytond/modules/account_asset/asset.py Wed Dec 03 13:58:43 2014 +0100
|
|
+++ .b/trytond/trytond/modules/account_asset/asset.py Wed Dec 03 16:13:09 2014 +0100
|
|
@@ -44,11 +44,15 @@
|
|
('product', '=', Eval('product', -1)),
|
|
),
|
|
('invoice.type', '=', 'in_invoice'),
|
|
+ ['OR',
|
|
+ ('company', '=', Eval('company', -1)),
|
|
+ ('invoice.company', '=', Eval('company', -1)),
|
|
+ ],
|
|
],
|
|
states={
|
|
'readonly': (Eval('lines', [0]) | (Eval('state') != 'draft')),
|
|
},
|
|
- depends=['product', 'state'])
|
|
+ depends=['product', 'state', 'company'])
|
|
customer_invoice_line = fields.Function(fields.Many2One(
|
|
'account.invoice.line', 'Customer Invoice Line'),
|
|
'get_customer_invoice_line')
|
|
@@ -141,12 +145,20 @@
|
|
], 'State', readonly=True)
|
|
lines = fields.One2Many('account.asset.line', 'asset', 'Lines',
|
|
readonly=True)
|
|
- move = fields.Many2One('account.move', 'Account Move', readonly=True)
|
|
+ move = fields.Many2One('account.move', 'Account Move', readonly=True,
|
|
+ domain=[
|
|
+ ('company', '=', Eval('company', -1)),
|
|
+ ],
|
|
+ depends=['company'])
|
|
update_moves = fields.Many2Many('account.asset-update-account.move',
|
|
'asset', 'move', 'Update Moves', readonly=True,
|
|
+ domain=[
|
|
+ ('company', '=', Eval('company', -1)),
|
|
+ ],
|
|
states={
|
|
'invisible': ~Eval('update_moves'),
|
|
- })
|
|
+ },
|
|
+ depends=['company'])
|
|
comment = fields.Text('Comment')
|
|
|
|
@classmethod
|
|
@@ -437,6 +449,7 @@
|
|
)
|
|
|
|
return Move(
|
|
+ company=self.company,
|
|
origin=line,
|
|
period=period_id,
|
|
journal=self.account_journal,
|
|
@@ -509,6 +522,7 @@
|
|
)
|
|
lines.append(counter_part_line)
|
|
return Move(
|
|
+ company=self.company,
|
|
origin=self,
|
|
period=period_id,
|
|
journal=self.account_journal,
|
|
@@ -746,6 +760,7 @@
|
|
Move = pool.get('account.move')
|
|
period_id = Period.find(asset.company.id, self.show_move.date)
|
|
return Move(
|
|
+ company=asset.company,
|
|
origin=asset,
|
|
journal=asset.account_journal.id,
|
|
period=period_id,
|