summaryrefslogtreecommitdiff
path: root/addons/account
diff options
context:
space:
mode:
authorJoseph Caburnay <jcb@odoo.com>2019-08-02 08:49:25 +0000
committerPierre Masereel <pim@odoo.com>2019-08-09 13:57:10 +0000
commit536560bbf55d1d9a6f5bd8d8f145f7bb13569ae4 (patch)
tree9d676515aba3df3a8a1166fac8149c01dcdb8cd5 /addons/account
parentaf91527929c2cd2266a0f5b7ea6b133002b4ef3e (diff)
[IMP] l10n_*: add new receivable account for pos
A new feature[*] in point_of_sale (PoS) which minimizes the creation of account.move records in closing a pos.session relies on a receivable account made specifically for PoS. This commit addresses this feature's requirement by adding a new receivable account to each localization. [*] point_of_sale: single AE for a pos.session TASK-ID: 1862388
Diffstat (limited to 'addons/account')
-rw-r--r--addons/account/models/chart_template.py7
-rw-r--r--addons/account/models/company.py3
2 files changed, 10 insertions, 0 deletions
diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py
index 62168bdd248..04f75ac4894 100644
--- a/addons/account/models/chart_template.py
+++ b/addons/account/models/chart_template.py
@@ -116,6 +116,7 @@ class AccountChartTemplate(models.Model):
string="Loss Exchange Rate Account", domain=[('internal_type', '=', 'other'), ('deprecated', '=', False)])
default_cash_difference_income_account_id = fields.Many2one('account.account.template', string="Cash Difference Income Account")
default_cash_difference_expense_account_id = fields.Many2one('account.account.template', string="Cash Difference Expense Account")
+ default_pos_receivable_account_id = fields.Many2one('account.account.template', string="PoS receivable account")
property_account_receivable_id = fields.Many2one('account.account.template', string='Receivable Account')
property_account_payable_id = fields.Many2one('account.account.template', string='Payable Account')
property_account_expense_categ_id = fields.Many2one('account.account.template', string='Category of Expense Account')
@@ -250,6 +251,12 @@ class AccountChartTemplate(models.Model):
'default_cash_difference_expense_account_id': acc_template_ref.get(self.default_cash_difference_expense_account_id.id, False),
})
+ # Set default PoS receivable account in company
+ if acc_template_ref.get(self.default_pos_receivable_account_id.id):
+ company.write({
+ 'account_default_pos_receivable_account_id': acc_template_ref[self.default_pos_receivable_account_id.id]
+ })
+
# Set the transfer account on the company
company.transfer_account_id = self.env['account.account'].search([('code', '=like', self.transfer_account_code_prefix + '%')])[0]
diff --git a/addons/account/models/company.py b/addons/account/models/company.py
index 34a9503c4ab..7c4743ee2b6 100644
--- a/addons/account/models/company.py
+++ b/addons/account/models/company.py
@@ -104,6 +104,9 @@ Best Regards,'''))
account_dashboard_onboarding_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done"), ('closed', "Closed")], string="State of the account dashboard onboarding panel", default='not_done')
invoice_terms = fields.Text(string='Default Terms and Conditions', translate=True)
+ # Needed in the Point of Sale
+ account_default_pos_receivable_account_id = fields.Many2one('account.account', string="Default PoS Receivable Account")
+
@api.constrains('account_opening_move_id', 'fiscalyear_last_day', 'fiscalyear_last_month')
def _check_fiscalyear_last_day(self):
# if the user explicitly chooses the 29th of February we allow it: