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

Proposed by jftempo
Status: Merged
Merged at revision: 4717
Proposed branch: lp:~julie-w/unifield-server/US-3944
Merge into: lp:unifield-server
Diff against target: 75 lines (+32/-0)
3 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+7/-0)
bin/addons/purchase/purchase_workflow.py (+12/-0)
bin/addons/sale/sale_workflow.py (+13/-0)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-3944
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+336988@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_profile/i18n/fr_MF.po'
2--- bin/addons/msf_profile/i18n/fr_MF.po 2017-12-12 10:23:48 +0000
3+++ bin/addons/msf_profile/i18n/fr_MF.po 2018-02-01 15:09:08 +0000
4@@ -101136,3 +101136,10 @@
5 #, python-format
6 msgid "You must select at least one currency of transfers."
7 msgstr "Vous devez sélectionner au moins une devise de virement."
8+
9+#. modules: purchase, sale
10+#: code:addons/purchase/purchase_workflow.py:413
11+#: code:addons/sale/sale_workflow.py:491
12+#, python-format
13+msgid "You can't use taxes with an intermission partner."
14+msgstr "Vous ne pouvez pas utiliser de taxes avec un partenaire intermission."
15
16=== modified file 'bin/addons/purchase/purchase_workflow.py'
17--- bin/addons/purchase/purchase_workflow.py 2017-12-14 17:30:55 +0000
18+++ bin/addons/purchase/purchase_workflow.py 2018-02-01 15:09:08 +0000
19@@ -400,6 +400,17 @@
20
21 return True
22
23+ def check_po_tax(self, cr, uid, ids, context=None):
24+ """
25+ Prevents from validating a PO with taxes when using an Intermission partner
26+ """
27+ if context is None:
28+ context = {}
29+ if isinstance(ids, (int, long)):
30+ ids = [ids]
31+ for po_line in self.browse(cr, uid, ids, fields_to_fetch=['order_id', 'taxes_id'], context=context):
32+ if po_line.taxes_id and po_line.order_id.partner_type == 'intermission':
33+ raise osv.except_osv(_('Error'), _("You can't use taxes with an intermission partner."))
34
35 def action_validate(self, cr, uid, ids, context=None):
36 '''
37@@ -415,6 +426,7 @@
38 self.check_analytic_distribution(cr, uid, ids, context=context)
39 self.check_if_stock_take_date_with_esc_partner(cr, uid, ids, context=context)
40 self.check_unit_price(cr, uid, ids, context=context)
41+ self.check_po_tax(cr, uid, ids, context=context)
42
43 # update FO lines:
44 self.update_fo_lines(cr, uid, ids, context=context)
45
46=== modified file 'bin/addons/sale/sale_workflow.py'
47--- bin/addons/sale/sale_workflow.py 2018-01-08 13:50:26 +0000
48+++ bin/addons/sale/sale_workflow.py 2018-02-01 15:09:08 +0000
49@@ -478,6 +478,17 @@
50 'purchase.order.line.sol_update_original_pol', self._logger, check_identifier=False, context=context)
51 return True
52
53+ def check_fo_tax(self, cr, uid, ids, context=None):
54+ """
55+ Prevents from validating a FO with taxes when using an Intermission partner
56+ """
57+ if context is None:
58+ context = {}
59+ if isinstance(ids, (int, long)):
60+ ids = [ids]
61+ for fo_line in self.browse(cr, uid, ids, fields_to_fetch=['order_id', 'tax_id'], context=context):
62+ if fo_line.tax_id and fo_line.order_id.partner_type == 'intermission':
63+ raise osv.except_osv(_('Error'), _("You can't use taxes with an intermission partner."))
64
65 def action_validate(self, cr, uid, ids, context=None):
66 '''
67@@ -488,6 +499,8 @@
68 if isinstance(ids, (int, long)):
69 ids = [ids]
70
71+ self.check_fo_tax(cr, uid, ids, context=context)
72+
73 for sol in self.browse(cr, uid, ids, context=context):
74 to_write = {}
75 if not sol.stock_take_date and sol.order_id.stock_take_date:

Subscribers

People subscribed via source and target branches