Merge lp:~dorian-kemps/unifield-server/US-10067-10068 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 6340
Proposed branch: lp:~dorian-kemps/unifield-server/US-10067-10068
Merge into: lp:unifield-server
Diff against target: 108 lines (+26/-11)
3 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+13/-2)
bin/addons/purchase/purchase_view.xml (+3/-2)
bin/addons/purchase/purchase_workflow.py (+10/-7)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-10067-10068
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+429839@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 2022-08-23 13:15:58 +0000
3+++ bin/addons/msf_profile/i18n/fr_MF.po 2022-09-13 15:34:42 +0000
4@@ -17188,14 +17188,25 @@
5 msgid "Warning!"
6 msgstr "Avertissement!"
7
8-#. modules: purchase, sale, account_override
9-#: code:addons/purchase/purchase_workflow.py:549
10+#. modules: sale, account_override
11 #: code:addons/sale/sale_workflow.py:529
12 #: code:addons/account_override/invoice.py:829
13 #, python-format
14 msgid "Taxes are forbidden with Intermission and Intersection partners."
15 msgstr "Les taxes sont interdites avec les partenaires Intermission et Intersection."
16
17+#. modules: purchase
18+#: code:addons/purchase/purchase_workflow.py:549
19+#, python-format
20+msgid "Taxes are forbidden with Internal, Intermission and Intersection partners."
21+msgstr "Les taxes sont interdites avec les partenaires Interne, Intermission et Intersection."
22+
23+#. modules: purchase
24+#: code:addons/purchase/purchase_workflow.py:607
25+#, python-format
26+msgid "Taxes are forbidden with the In Kind Donation Order Type."
27+msgstr "Les taxes sont interdites avec le Type de Commande Donation en Nature."
28+
29 #. module: account
30 #: model:ir.actions.act_window,name:account.action_account_fiscal_position_form
31 #: model:ir.ui.menu,name:account.menu_action_account_fiscal_position_form
32
33=== modified file 'bin/addons/purchase/purchase_view.xml'
34--- bin/addons/purchase/purchase_view.xml 2022-08-09 15:41:58 +0000
35+++ bin/addons/purchase/purchase_view.xml 2022-09-13 15:34:42 +0000
36@@ -388,7 +388,7 @@
37 </tree>
38 </field>
39 <field name="has_tax_at_line_level" invisible="1" />
40- <field name="tax_line" nolabel="1" attrs="{'invisible': [('partner_type', '!=', 'external')], 'readonly': ['|', ('not_beyond_validated','=', False), ('has_tax_at_line_level', '=', True)]}">
41+ <field name="tax_line" nolabel="1" attrs="{'invisible': ['|', ('partner_type', '!=', 'external'), ('order_type', '=', 'in_kind')], 'readonly': ['|', ('not_beyond_validated','=', False), ('has_tax_at_line_level', '=', True)]}">
42 <tree editable="bottom" string="Taxes">
43 <field name="account_tax_id" on_change="tax_code_change(account_tax_id, parent.amount_untaxed, parent.partner_id, context)" />
44 <field name="name"/>
45@@ -698,7 +698,8 @@
46 </group>
47
48 <field name="vat_ok" invisible="1"/>
49- <group colspan="4" col="4" attrs="{'invisible': [('vat_ok', '=', False)]}">
50+ <field name="po_partner_type_stored" invisible="1"/>
51+ <group colspan="4" col="4" attrs="{'invisible': ['|', '|', ('vat_ok', '=', False), ('po_partner_type_stored', '=', 'internal'), ('po_order_type', '=', 'in_kind')]}">
52 <separator colspan="4" string="Taxes"/>
53 <field colspan="4" nolabel="1" name="taxes_id" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
54 </group>
55
56=== modified file 'bin/addons/purchase/purchase_workflow.py'
57--- bin/addons/purchase/purchase_workflow.py 2022-04-06 16:04:57 +0000
58+++ bin/addons/purchase/purchase_workflow.py 2022-09-13 15:34:42 +0000
59@@ -47,7 +47,7 @@
60 self.check_analytic_distribution(cr, uid, ids_to_check, context=context)
61 self.check_if_stock_take_date_with_esc_partner(cr, uid, ids_to_check, context=context)
62 self.check_unit_price(cr, uid, ids_to_check, context=context)
63- self.check_po_tax(cr, uid, ids_to_check, context=context)
64+ self.check_pol_tax(cr, uid, ids_to_check, context=context)
65 wiz_id = self.pool.get('purchase.order.line.nsl.validation.wizard').create(cr, uid, {'pol_ids': [(6, 0, ids)], 'message': ', '.join(nsl)}, context=context)
66 return {
67 'type': 'ir.actions.act_window',
68@@ -591,17 +591,20 @@
69
70 return True
71
72- def check_po_tax(self, cr, uid, ids, context=None):
73+ def check_pol_tax(self, cr, uid, ids, context=None):
74 """
75- Prevents from validating a PO with taxes when using an Intermission or Intersection partner
76+ Prevents from validating a PO line with taxes when using an Internal, Intermission or Intersection partner; and
77+ with an In Kind Donation Order Type
78 """
79 if context is None:
80 context = {}
81 if isinstance(ids, (int, long)):
82 ids = [ids]
83 for po_line in self.browse(cr, uid, ids, fields_to_fetch=['order_id', 'taxes_id'], context=context):
84- if po_line.taxes_id and po_line.order_id.partner_type in ('intermission', 'section'):
85- raise osv.except_osv(_('Error'), _("Taxes are forbidden with Intermission and Intersection partners."))
86+ if po_line.taxes_id and po_line.order_id.partner_type in ('internal', 'intermission', 'section'):
87+ raise osv.except_osv(_('Error'), _("Taxes are forbidden with Internal, Intermission and Intersection partners."))
88+ if po_line.taxes_id and po_line.order_id.order_type == 'in_kind':
89+ raise osv.except_osv(_('Error'), _("Taxes are forbidden with the In Kind Donation Order Type."))
90
91 def check_origin_for_validation(self, cr, uid, ids, context=None):
92 if not context:
93@@ -636,7 +639,7 @@
94 self.check_analytic_distribution(cr, uid, ids, context=context)
95 self.check_if_stock_take_date_with_esc_partner(cr, uid, ids, context=context)
96 self.check_unit_price(cr, uid, ids, context=context)
97- self.check_po_tax(cr, uid, ids, context=context)
98+ self.check_pol_tax(cr, uid, ids, context=context)
99
100 # update FO lines:
101 self.update_fo_lines(cr, uid, ids, context=context)
102@@ -956,7 +959,7 @@
103 if isinstance(ids, (int, long)):
104 ids = [ids]
105
106- po = self.browse(cr, uid, ids[0], context=context)
107+ po = self.browse(cr, uid, ids[0], fields_to_fetch=['order_line'], context=context)
108 return self.pool.get('purchase.order.line').validated(cr, uid, [pol.id for pol in po.order_line], context=context)
109
110

Subscribers

People subscribed via source and target branches