account_usability: adapt context for suspensed_account_id for user_type_id
This commit follows a change in the account module made in this commit: c16bc3192f
Improve multi-company support in the wizard account.group.generate
Remove widget="selection" on fiscal_position on res.partner form
This commit is contained in:
@@ -16,10 +16,7 @@ class AccountJournal(models.Model):
|
|||||||
"you don't want to enter the start/end balance manually: it "
|
"you don't want to enter the start/end balance manually: it "
|
||||||
"will prevent the display of wrong information in the accounting "
|
"will prevent the display of wrong information in the accounting "
|
||||||
"dashboard and on bank statements.")
|
"dashboard and on bank statements.")
|
||||||
# Used to set default user_type_id on account fields
|
# Used to set default user_type_id on account fields via context
|
||||||
account_type_current_liabilities_id = fields.Many2one(
|
|
||||||
'account.account.type',
|
|
||||||
default=lambda self: self.env.ref('account.data_account_type_current_liabilities').id)
|
|
||||||
account_type_current_assets_id = fields.Many2one(
|
account_type_current_assets_id = fields.Many2one(
|
||||||
'account.account.type',
|
'account.account.type',
|
||||||
default=lambda self: self.env.ref('account.data_account_type_current_assets').id)
|
default=lambda self: self.env.ref('account.data_account_type_current_assets').id)
|
||||||
|
|||||||
@@ -14,11 +14,10 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="bank_statements_source" position="after">
|
<field name="bank_statements_source" position="after">
|
||||||
<field name="hide_bank_statement_balance" groups="account.group_account_readonly"/>
|
<field name="hide_bank_statement_balance" groups="account.group_account_readonly"/>
|
||||||
<field name="account_type_current_liabilities_id" invisible="1"/>
|
|
||||||
<field name="account_type_current_assets_id" invisible="1"/>
|
<field name="account_type_current_assets_id" invisible="1"/>
|
||||||
</field>
|
</field>
|
||||||
<field name="suspense_account_id" position="attributes">
|
<field name="suspense_account_id" position="attributes">
|
||||||
<attribute name="context">{'default_user_type_id': account_type_current_liabilities_id, 'default_reconcile': True}</attribute>
|
<attribute name="context">{'default_user_type_id': account_type_current_assets_id, 'default_reconcile': True}</attribute>
|
||||||
</field>
|
</field>
|
||||||
<field name="payment_debit_account_id" position="attributes">
|
<field name="payment_debit_account_id" position="attributes">
|
||||||
<attribute name="context">{'default_user_type_id': account_type_current_assets_id, 'default_reconcile': True}</attribute>
|
<attribute name="context">{'default_user_type_id': account_type_current_assets_id, 'default_reconcile': True}</attribute>
|
||||||
|
|||||||
@@ -13,9 +13,6 @@
|
|||||||
<field name="model">res.partner</field>
|
<field name="model">res.partner</field>
|
||||||
<field name="inherit_id" ref="account.view_partner_property_form"/>
|
<field name="inherit_id" ref="account.view_partner_property_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="property_account_position_id" position="attributes">
|
|
||||||
<attribute name="widget">selection</attribute>
|
|
||||||
</field>
|
|
||||||
<xpath expr="//field[@name='bank_ids']/tree/field[@name='acc_number']" position="after">
|
<xpath expr="//field[@name='bank_ids']/tree/field[@name='acc_number']" position="after">
|
||||||
<field name="acc_type"/>
|
<field name="acc_type"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ class AccountGroupGenerate(models.TransientModel):
|
|||||||
_name = 'account.group.generate'
|
_name = 'account.group.generate'
|
||||||
_description = 'Generate Account Groups'
|
_description = 'Generate Account Groups'
|
||||||
|
|
||||||
|
company_id = fields.Many2one(
|
||||||
|
'res.company', string='Company', required=True,
|
||||||
|
default=lambda self: self.env.company)
|
||||||
name_prefix = fields.Char(string='Prefix', required=True, default='Comptes')
|
name_prefix = fields.Char(string='Prefix', required=True, default='Comptes')
|
||||||
level = fields.Integer(default=2, required=True)
|
level = fields.Integer(default=2, required=True)
|
||||||
|
|
||||||
@@ -18,7 +21,7 @@ class AccountGroupGenerate(models.TransientModel):
|
|||||||
raise UserError(_("The level must be >= 1."))
|
raise UserError(_("The level must be >= 1."))
|
||||||
ago = self.env['account.group']
|
ago = self.env['account.group']
|
||||||
aao = self.env['account.account']
|
aao = self.env['account.account']
|
||||||
company = self.env.company
|
company = self.company_id
|
||||||
groups = ago.search([('company_id', '=', company.id)])
|
groups = ago.search([('company_id', '=', company.id)])
|
||||||
if groups:
|
if groups:
|
||||||
raise UserError(_(
|
raise UserError(_(
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
This wizard is designed to auto-generate account groups from the chart of account.
|
This wizard is designed to auto-generate account groups from the chart of account.
|
||||||
</p>
|
</p>
|
||||||
<group name="main">
|
<group name="main">
|
||||||
|
<field name="company_id" groups="base.group_multi_company"/>
|
||||||
<field name="name_prefix"/>
|
<field name="name_prefix"/>
|
||||||
<field name="level"/>
|
<field name="level"/>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
Reference in New Issue
Block a user