summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorJosse Colpaert <jco@odoo.com>2019-10-02 10:16:08 +0000
committerJosse Colpaert <jco@odoo.com>2019-10-02 10:16:26 +0000
commit8ba449ccddce3e46e2d5115151bdbfbd06f2c56d (patch)
treed2254731fb77ffdd697540b2c6bc0cec8110ecaf /addons
parentd46befdf25ad6a1f4c47a0308f2fbadfcfbcc6b7 (diff)
[FIX] account: pos receivable account might be only set on the parent
On installation of the CoA the company's pos receivable account is set, but it is possible that the account is not set on the chart template itself, but on its parent. closes odoo/odoo#37761 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/chart_template.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py
index abe030637f2..b011a0914ce 100644
--- a/addons/account/models/chart_template.py
+++ b/addons/account/models/chart_template.py
@@ -232,9 +232,12 @@ class AccountChartTemplate(models.Model):
})
# Set default PoS receivable account in company
- if acc_template_ref.get(self.default_pos_receivable_account_id.id):
+ default_pos_receivable = self.default_pos_receivable_account_id.id
+ if not default_pos_receivable and self.parent_id:
+ default_pos_receivable = self.parent_id.default_pos_receivable_account_id.id
+ if acc_template_ref.get(default_pos_receivable):
company.write({
- 'account_default_pos_receivable_account_id': acc_template_ref[self.default_pos_receivable_account_id.id]
+ 'account_default_pos_receivable_account_id': acc_template_ref[default_pos_receivable]
})
# Set the transfer account on the company