Merge lp:~julie-w/unifield-server/US-4306 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4773
Proposed branch: lp:~julie-w/unifield-server/US-4306
Merge into: lp:unifield-server
Diff against target: 87 lines (+41/-0) (has conflicts)
2 files modified
bin/addons/msf_partner/partner.py (+27/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+14/-0)
Text conflict in bin/addons/msf_partner/partner.py
Text conflict in bin/addons/msf_profile/i18n/fr_MF.po
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-4306
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+340472@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_partner/partner.py'
2--- bin/addons/msf_partner/partner.py 2018-03-01 16:19:31 +0000
3+++ bin/addons/msf_partner/partner.py 2018-03-02 15:56:40 +0000
4@@ -23,6 +23,7 @@
5 from osv import osv
6 from osv import fields
7 from msf_partner import PARTNER_TYPE
8+from account_override import ACCOUNT_RESTRICTED_AREA
9 from msf_field_access_rights.osv_override import _get_instance_level
10 import time
11 from tools.translate import _
12@@ -588,6 +589,7 @@
13 +[_('%s (Journal Item)') % (aml['move_id'] and aml['move_id'][1] or '') for aml in aml_obj.read(cr, uid, aml_ids, ['move_id'])]
14 )
15
16+<<<<<<< TREE
17 def check_partner_unicity(self, cr, uid, partner_id, context=None):
18 """
19 If the partner name is already used, check that the city is not empty AND not used by another partner with the
20@@ -619,6 +621,30 @@
21
22 return ret
23
24+=======
25+ def _check_default_accounts(self, cr, uid, vals, context=None):
26+ """
27+ Checks if the property_account_receivable and property_account_payable in vals are allowed based on the domains
28+ stored in ACCOUNT_RESTRICTED_AREA. If not raises a warning.
29+ """
30+ if context is None:
31+ context = {}
32+ if not context.get('sync_update_execution'):
33+ account_obj = self.pool.get('account.account')
34+ if vals.get('property_account_receivable'):
35+ receivable_domain = [('id', '=', vals['property_account_receivable'])]
36+ receivable_domain.extend(ACCOUNT_RESTRICTED_AREA['partner_receivable'])
37+ if not account_obj.search_exist(cr, uid, receivable_domain, context=context):
38+ receivable_acc = account_obj.browse(cr, uid, vals['property_account_receivable'], fields_to_fetch=['code', 'name'], context=context)
39+ raise osv.except_osv(_('Error'), _('The account %s - %s cannot be used as Account Receivable.') % (receivable_acc.code, receivable_acc.name))
40+ if vals.get('property_account_payable'):
41+ payable_domain = [('id', '=', vals['property_account_payable'])]
42+ payable_domain.extend(ACCOUNT_RESTRICTED_AREA['partner_payable'])
43+ if not account_obj.search_exist(cr, uid, payable_domain, context=context):
44+ payable_acc = account_obj.browse(cr, uid, vals['property_account_payable'], fields_to_fetch=['code', 'name'], context=context)
45+ raise osv.except_osv(_('Error'), _('The account %s - %s cannot be used as Account Payable.') % (payable_acc.code, payable_acc.name))
46+
47+>>>>>>> MERGE-SOURCE
48 def write(self, cr, uid, ids, vals, context=None):
49 if not ids:
50 return True
51@@ -663,6 +689,7 @@
52 if context is None:
53 context = {}
54 vals = self.check_pricelists_vals(cr, uid, vals, context=context)
55+ self._check_default_accounts(cr, uid, vals, context=context)
56 if 'partner_type' in vals and vals['partner_type'] in ('internal', 'section', 'esc', 'intermission'):
57 msf_customer = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_internal_customers')
58 msf_supplier = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_internal_suppliers')
59
60=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
61--- bin/addons/msf_profile/i18n/fr_MF.po 2018-03-01 16:19:31 +0000
62+++ bin/addons/msf_profile/i18n/fr_MF.po 2018-03-02 15:56:40 +0000
63@@ -107116,6 +107116,7 @@
64 msgid "Page need to be refreshed - please press \"F5\""
65 msgstr "La page doit être rafraîchie, veuillez cliquer sur \"F5\""
66
67+<<<<<<< TREE
68 #. module: msf_partner
69 #: code:addons/msf_partner/partner.py:623
70 #, python-format
71@@ -107195,3 +107196,16 @@
72 msgid "Access Denied"
73 msgstr "Accès Refusé"
74
75+=======
76+#. module: msf_partner
77+#: code:addons/msf_partner/partner.py:611
78+#, python-format
79+msgid "The account %s - %s cannot be used as Account Receivable."
80+msgstr "Le compte %s - %s ne peut pas être utilisé comme Compte Client."
81+
82+#. module: msf_partner
83+#: code:addons/msf_partner/partner.py:617
84+#, python-format
85+msgid "The account %s - %s cannot be used as Account Payable."
86+msgstr "Le compte %s - %s ne peut pas être utilisé comme Compte Fournisseur."
87+>>>>>>> MERGE-SOURCE

Subscribers

People subscribed via source and target branches