60 lines
2.4 KiB
Diff
60 lines
2.4 KiB
Diff
Index: trytond/trytond/modules/analytic_account/account.xml
|
|
===================================================================
|
|
|
|
--- a/trytond/trytond/modules/analytic_account/account.xml
|
|
+++ b/trytond/trytond/modules/analytic_account/account.xml
|
|
@@ -104,15 +104,6 @@
|
|
<field name="perm_delete" eval="True"/>
|
|
</record>
|
|
|
|
- <record model="ir.rule.group" id="rule_group_account">
|
|
- <field name="model" search="[('model', '=', 'analytic_account.account')]"/>
|
|
- <field name="global_p" eval="True"/>
|
|
- </record>
|
|
- <record model="ir.rule" id="rule_account1">
|
|
- <field name="domain">[('company', 'in', [c.id for c in user.companies])]</field>
|
|
- <field name="rule_group" ref="rule_group_account"/>
|
|
- </record>
|
|
-
|
|
<record model="ir.ui.view" id="open_chart_start_view_form">
|
|
<field name="model">analytic_account.open_chart.start</field>
|
|
<field name="type">form</field>
|
|
|
|
Index: trytond/trytond/modules/analytic_account/line.py
|
|
===================================================================
|
|
|
|
--- a/trytond/trytond/modules/analytic_account/line.py
|
|
+++ b/trytond/trytond/modules/analytic_account/line.py
|
|
@@ -23,8 +23,17 @@
|
|
'Currency'), 'on_change_with_currency')
|
|
currency_digits = fields.Function(fields.Integer('Currency Digits'),
|
|
'on_change_with_currency_digits')
|
|
+ company = fields.Function(fields.Many2One('company.company', 'Company'),
|
|
+ 'on_change_with_company')
|
|
account = fields.Many2One('analytic_account.account', 'Account',
|
|
- required=True, select=True, domain=[('type', '!=', 'view')])
|
|
+ required=True, select=True, domain=[
|
|
+ ('type', '!=', 'view'),
|
|
+ ['OR',
|
|
+ ('company', '=', None),
|
|
+ ('company', '=', Eval('company', -1)),
|
|
+ ],
|
|
+ ],
|
|
+ depends=['company'])
|
|
move_line = fields.Many2One('account.move.line', 'Account Move Line',
|
|
ondelete='CASCADE', required=True)
|
|
journal = fields.Many2One('account.journal', 'Journal', required=True,
|
|
@@ -89,6 +98,11 @@
|
|
return self.move_line.account.company.currency.digits
|
|
return 2
|
|
|
|
+ @fields.depends('move_line')
|
|
+ def on_change_with_company(self, name=None):
|
|
+ if self.move_line:
|
|
+ return self.move_line.account.company.id
|
|
+
|
|
@staticmethod
|
|
def query_get(table):
|
|
'''
|
|
|