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

Proposed by jftempo
Status: Merged
Merged at revision: 6280
Proposed branch: lp:~dorian-kemps/unifield-server/US-8428
Merge into: lp:unifield-server
Diff against target: 308 lines (+94/-44) (has conflicts)
6 files modified
bin/addons/msf_profile/data/patches.xml (+8/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+28/-15)
bin/addons/msf_profile/msf_profile.py (+12/-0)
bin/addons/stock/physical_inventory.py (+38/-20)
bin/addons/stock/physical_inventory_view.xml (+7/-8)
bin/addons/stock/wizard/physical_inventory_select_products.py (+1/-1)
Text conflict in bin/addons/msf_profile/data/patches.xml
Text conflict in bin/addons/msf_profile/i18n/fr_MF.po
Text conflict in bin/addons/msf_profile/msf_profile.py
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-8428
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+425392@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
=== modified file 'bin/addons/msf_profile/data/patches.xml'
--- bin/addons/msf_profile/data/patches.xml 2022-05-30 15:32:49 +0000
+++ bin/addons/msf_profile/data/patches.xml 2022-06-27 14:49:29 +0000
@@ -787,9 +787,17 @@
787 <field name="method">us_5722_update_accruals</field>787 <field name="method">us_5722_update_accruals</field>
788 </record>788 </record>
789789
790<<<<<<< TREE
790 <record id="us_8259_remove_currency_table_wkf" model="patch.scripts">791 <record id="us_8259_remove_currency_table_wkf" model="patch.scripts">
791 <field name="method">us_8259_remove_currency_table_wkf</field>792 <field name="method">us_8259_remove_currency_table_wkf</field>
792 </record>793 </record>
793794
795=======
796 <!-- UF26.0 -->
797 <record id="us_8428_pi_type_migration" model="patch.scripts">
798 <field name="method">us_8428_pi_type_migration</field>
799 </record>
800
801>>>>>>> MERGE-SOURCE
794 </data>802 </data>
795</openerp>803</openerp>
796804
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2022-06-20 12:58:24 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2022-06-27 14:49:29 +0000
@@ -10132,11 +10132,6 @@
10132msgid "Nauru"10132msgid "Nauru"
10133msgstr "Nauru"10133msgstr "Nauru"
1013410134
10135#. module: stock
10136#: field:physical.inventory.select.products,full_inventory:0
10137msgid "Full Inventory"
10138msgstr "Inventaire Complet"
10139
10140#. module: purchase10135#. module: purchase
10141#: model:ir.actions.act_window,name:purchase.action_purchase_order_report_all10136#: model:ir.actions.act_window,name:purchase.action_purchase_order_report_all
10142#: model:ir.ui.menu,name:purchase.menu_action_purchase_order_report_all10137#: model:ir.ui.menu,name:purchase.menu_action_purchase_order_report_all
@@ -45790,11 +45785,6 @@
45790msgid "Anguilla"45785msgid "Anguilla"
45791msgstr "Anguille"45786msgstr "Anguille"
4579245787
45793#. module: stock
45794#: view:physical.inventory:0
45795msgid "Set as full inventory"
45796msgstr "Marquer comme inventaire complet"
45797
45798#. module: msf_doc_import45788#. module: msf_doc_import
45799#: code:addons/msf_doc_import/wizard/wizard_import_fo_line.py:13445789#: code:addons/msf_doc_import/wizard/wizard_import_fo_line.py:134
45800#: code:addons/msf_doc_import/wizard/wizard_import_product_line.py:12445790#: code:addons/msf_doc_import/wizard/wizard_import_product_line.py:124
@@ -79033,11 +79023,6 @@
79033msgid "Sourced"79023msgid "Sourced"
79034msgstr "Sourcé"79024msgstr "Sourcé"
7903579025
79036#. module: stock
79037#: view:physical.inventory:0
79038msgid "Setting as 'full inventory' is irreversible. Do you confirm ?"
79039msgstr "Marquer comme étant 'inventaire complet' est irréversible. Voulez-vous continuer ?"
79040
79041#. module: consumption_calculation79026#. module: consumption_calculation
79042#: model:ir.actions.report.xml,name:consumption_calculation.report_incoming_consumption_xls79027#: model:ir.actions.report.xml,name:consumption_calculation.report_incoming_consumption_xls
79043#: model:ir.actions.server,name:consumption_calculation.action_incoming_print_xml_export79028#: model:ir.actions.server,name:consumption_calculation.action_incoming_print_xml_export
@@ -115057,6 +115042,7 @@
115057#, python-format115042#, python-format
115058msgid "Cannot update these products, ED/BN attributes have not changed since the KCL creation"115043msgid "Cannot update these products, ED/BN attributes have not changed since the KCL creation"
115059msgstr "Impossible de mettre à jour ces produits. Les attributs NL/DE n'ont pas changé depuis la création du Kit"115044msgstr "Impossible de mettre à jour ces produits. Les attributs NL/DE n'ont pas changé depuis la création du Kit"
115045<<<<<<< TREE
115060115046
115061#. module: board115047#. module: board
115062#: report:addons/board/report/integrity.mako:83115048#: report:addons/board/report/integrity.mako:83
@@ -115185,3 +115171,30 @@
115185#, python-format115171#, python-format
115186msgid "Import error for account \"%s\" : Listing both Accounts/Destinations and G/L Accounts is not allowed"115172msgid "Import error for account \"%s\" : Listing both Accounts/Destinations and G/L Accounts is not allowed"
115187msgstr "Erreur lors de l'import du compte \"%s\" : Lister à la fois les Comptes/Destinations et les Comptes Grand Livre n'est pas permis"115173msgstr "Erreur lors de l'import du compte \"%s\" : Lister à la fois les Comptes/Destinations et les Comptes Grand Livre n'est pas permis"
115174=======
115175
115176#. module: stock
115177#: selection:physical.inventory,type:0
115178msgid "Full Inventory count (planned)"
115179msgstr "Comptage complet de l'Inventaire (planifié)"
115180
115181#. module: stock
115182#: selection:physical.inventory,type:0
115183msgid "Partial Inventory count (planned)"
115184msgstr "Comptage partiel de l'Inventaire (planifié)"
115185
115186#. module: stock
115187#: selection:physical.inventory,type:0
115188msgid "Stock correction (unplanned)"
115189msgstr "Correction du Stock (non planifiée)"
115190
115191#. module: stock
115192#: field:physical.inventory,products_added:0
115193msgid "Has products"
115194msgstr "A des produits"
115195
115196#. module: stock
115197#: field:physical.inventory,type:0
115198msgid "Inventory Type"
115199msgstr "Type d'Inventaire"
115200>>>>>>> MERGE-SOURCE
115188115201
=== modified file 'bin/addons/msf_profile/msf_profile.py'
--- bin/addons/msf_profile/msf_profile.py 2022-05-30 15:32:49 +0000
+++ bin/addons/msf_profile/msf_profile.py 2022-06-27 14:49:29 +0000
@@ -56,12 +56,24 @@
56 'model': lambda *a: 'patch.scripts',56 'model': lambda *a: 'patch.scripts',
57 }57 }
5858
59<<<<<<< TREE
59 def us_8259_remove_currency_table_wkf(self, cr, uid, *a, **b):60 def us_8259_remove_currency_table_wkf(self, cr, uid, *a, **b):
60 cr.execute("delete from wkf_workitem where act_id in (select id from wkf_activity where wkf_id = (select id from wkf where name='wkf.res.currency.table' and osv='res.currency.table'))")61 cr.execute("delete from wkf_workitem where act_id in (select id from wkf_activity where wkf_id = (select id from wkf where name='wkf.res.currency.table' and osv='res.currency.table'))")
61 cr.execute("delete from wkf_activity where wkf_id = (select id from wkf where name='wkf.res.currency.table' and osv='res.currency.table')")62 cr.execute("delete from wkf_activity where wkf_id = (select id from wkf where name='wkf.res.currency.table' and osv='res.currency.table')")
62 cr.execute("delete from wkf where name='wkf.res.currency.table' and osv='res.currency.table'")63 cr.execute("delete from wkf where name='wkf.res.currency.table' and osv='res.currency.table'")
63 return True64 return True
6465
66=======
67 # UF26.0
68 def us_8428_pi_type_migration(self, cr, uid, *a, **b):
69 '''
70 In PIs, if full_inventory == True, set the type to 'full'
71 '''
72 cr.execute("""UPDATE physical_inventory SET type = 'full' WHERE full_inventory = 't'""")
73
74 return True
75
76>>>>>>> MERGE-SOURCE
65 # UF25.077 # UF25.0
66 def us_8451_split_rr(self, cr, uid, *a, **b):78 def us_8451_split_rr(self, cr, uid, *a, **b):
67 if not cr.column_exists('replenishment_segment_line', 'rr_fmc_1') or not cr.column_exists('replenishment_segment_line', 'rr_max_1'):79 if not cr.column_exists('replenishment_segment_line', 'rr_fmc_1') or not cr.column_exists('replenishment_segment_line', 'rr_max_1'):
6880
=== modified file 'bin/addons/stock/physical_inventory.py'
--- bin/addons/stock/physical_inventory.py 2022-05-19 09:23:30 +0000
+++ bin/addons/stock/physical_inventory.py 2022-06-27 14:49:29 +0000
@@ -105,6 +105,25 @@
105105
106 return totals106 return totals
107107
108 def _get_products_added(self, cr, uid, ids, field_name, arg, context=None):
109 if not ids:
110 return False
111
112 cr.execute("""
113 SELECT pi.id, count(rel.product_id)
114 FROM
115 physical_inventory pi
116 LEFT JOIN
117 physical_inventory_product_rel rel ON rel.product_id = pi.id
118 WHERE
119 pi.id in %s
120 GROUP BY pi.id
121 """, (tuple(ids), ))
122 ret = {}
123 for x in cr.fetchall():
124 ret[x[0]] = x[1] > 0
125
126 return ret
108127
109 _columns = {128 _columns = {
110 'ref': fields.char('Reference', size=64, readonly=True, sort_column='id'),129 'ref': fields.char('Reference', size=64, readonly=True, sort_column='id'),
@@ -113,6 +132,7 @@
113 'responsible': fields.char('Responsible', size=128, required=False, states={'closed': [('readonly',True)], 'cancel': [('readonly',True)]}),132 'responsible': fields.char('Responsible', size=128, required=False, states={'closed': [('readonly',True)], 'cancel': [('readonly',True)]}),
114 'date_done': fields.datetime('Date done', readonly=True),133 'date_done': fields.datetime('Date done', readonly=True),
115 'date_confirmed': fields.datetime('Date confirmed', readonly=True),134 'date_confirmed': fields.datetime('Date confirmed', readonly=True),
135 # 'inventory_id' and 'product_id' seem to be inverted in product_ids
116 'product_ids': fields.many2many('product.product', 'physical_inventory_product_rel',136 'product_ids': fields.many2many('product.product', 'physical_inventory_product_rel',
117 'product_id', 'inventory_id', string="Product selection", domain=[('type', 'not in', ['service_recep', 'consu'])], order_by="default_code"),137 'product_id', 'inventory_id', string="Product selection", domain=[('type', 'not in', ['service_recep', 'consu'])], order_by="default_code"),
118 'discrepancy_line_ids': fields.one2many('physical.inventory.discrepancy', 'inventory_id', 'Discrepancy lines',138 'discrepancy_line_ids': fields.one2many('physical.inventory.discrepancy', 'inventory_id', 'Discrepancy lines',
@@ -127,6 +147,8 @@
127 'company_id': fields.many2one('res.company', 'Company', readonly=True, select=True, required=True,147 'company_id': fields.many2one('res.company', 'Company', readonly=True, select=True, required=True,
128 states={'draft': [('readonly', False)]}),148 states={'draft': [('readonly', False)]}),
129 'full_inventory': fields.boolean('Full inventory', readonly=True),149 'full_inventory': fields.boolean('Full inventory', readonly=True),
150 'type': fields.selection([('full', 'Full Inventory count (planned)'), ('partial', 'Partial Inventory count (planned)'),
151 ('correction', 'Stock correction (unplanned)')], 'Inventory Type', required=True, select=True),
130 'discrepancies_generated': fields.boolean('Discrepancies Generated', readonly=True),152 'discrepancies_generated': fields.boolean('Discrepancies Generated', readonly=True),
131 'file_to_import': fields.binary(string='File to import', filters='*.xml'),153 'file_to_import': fields.binary(string='File to import', filters='*.xml'),
132 'file_to_import2': fields.binary(string='File to import', filters='*.xml'),154 'file_to_import2': fields.binary(string='File to import', filters='*.xml'),
@@ -143,8 +165,9 @@
143 'discrepancy_lines_percent_absvalue': fields.function(_inventory_totals, multi="inventory_total", method=True, type='float', string=_("Percent of absolute value of discrepancies")),165 'discrepancy_lines_percent_absvalue': fields.function(_inventory_totals, multi="inventory_total", method=True, type='float', string=_("Percent of absolute value of discrepancies")),
144 'bad_stock_msg': fields.text('Bad Stock', readonly=1),166 'bad_stock_msg': fields.text('Bad Stock', readonly=1),
145 'has_bad_stock': fields.boolean('Has bad Stock', readonly=1),167 'has_bad_stock': fields.boolean('Has bad Stock', readonly=1),
146 'max_filter_months': fields.integer('Months selected in "Products with recent movement at location" during Product Selection', readonly=1),168 'max_filter_months': fields.integer('Months selected in "Products with recent movement at location" during Product Selection'),
147 'multiple_filter_months': fields.boolean('Multiple Selection', readonly=1),169 'multiple_filter_months': fields.boolean('Multiple Selection'),
170 'products_added': fields.function(_get_products_added, method=True, type='boolean', string='Has products'),
148 }171 }
149172
150 _defaults = {173 _defaults = {
@@ -152,14 +175,15 @@
152 'date': lambda *a: time.strftime(DEFAULT_SERVER_DATETIME_FORMAT),175 'date': lambda *a: time.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
153 'state': 'draft',176 'state': 'draft',
154 'full_inventory': False,177 'full_inventory': False,
178 'type': 'partial',
155 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'physical.inventory', context=c),179 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'physical.inventory', context=c),
156 'has_bad_stock': False,180 'has_bad_stock': False,
157 'discrepancies_generated': False,181 'discrepancies_generated': False,
158 'max_filter_months': -1,182 'max_filter_months': -1,
159 'multiple_filter_months': False,183 'multiple_filter_months': False,
184 'products_added': False,
160 }185 }
161186
162
163 def create(self, cr, uid, values, context):187 def create(self, cr, uid, values, context):
164 context = context is None and {} or context188 context = context is None and {} or context
165 values["ref"] = self.pool.get('ir.sequence').get(cr, uid, 'physical.inventory')189 values["ref"] = self.pool.get('ir.sequence').get(cr, uid, 'physical.inventory')
@@ -170,7 +194,6 @@
170 raise osv.except_osv(_('Warning'), _("Location is inactive"))194 raise osv.except_osv(_('Warning'), _("Location is inactive"))
171 return new_id195 return new_id
172196
173
174 def copy(self, cr, uid, id_, default=None, context=None):197 def copy(self, cr, uid, id_, default=None, context=None):
175 default = default is None and {} or default198 default = default is None and {} or default
176 context = context is None and {} or context199 context = context is None and {} or context
@@ -178,6 +201,7 @@
178201
179 default['state'] = 'draft'202 default['state'] = 'draft'
180 default['date'] = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)203 default['date'] = time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
204 default['type'] = 'partial'
181 fields_to_empty = ["ref",205 fields_to_empty = ["ref",
182 "full_inventory",206 "full_inventory",
183 "date_done",207 "date_done",
@@ -197,19 +221,14 @@
197221
198 return super(PhysicalInventory, self).copy(cr, uid, id_, default, context=context)222 return super(PhysicalInventory, self).copy(cr, uid, id_, default, context=context)
199223
200
201 def perm_write(self, cr, user, ids, fields, context=None):224 def perm_write(self, cr, user, ids, fields, context=None):
202 pass225 pass
203226
204227 def onchange_products(self, cr, uid, ids, product_ids, context=None):
205 def set_full_inventory(self, cr, uid, ids, context=None):228 res = {'value': {'products_added': product_ids != [(6, 0, [])]}}
206 context = context is None and {} or context229 if product_ids == [(6, 0, [])]:
207230 res['value'].update({'max_filter_months': -1, 'multiple_filter_months': False})
208 # Set full inventory as true and unlink all products already selected231 return res
209 self.write(cr, uid, ids, {'full_inventory': True,
210 'product_ids': [(5)]}, context=context)
211 return {}
212
213232
214 def action_select_products(self, cr, uid, ids, context=None):233 def action_select_products(self, cr, uid, ids, context=None):
215 """234 """
@@ -229,13 +248,12 @@
229 assert len(ids) == 1248 assert len(ids) == 1
230 inventory_id = ids[0]249 inventory_id = ids[0]
231250
232 # Is it a full inventory ?251 # Create the wizard, check if it is a full inventory
233 full_inventory = read_single(self._name, inventory_id, 'full_inventory')
234
235 # Create the wizard
236 wiz_model = 'physical.inventory.select.products'252 wiz_model = 'physical.inventory.select.products'
237 wiz_values = {"inventory_id": inventory_id,253 wiz_values = {
238 "full_inventory": full_inventory }254 "inventory_id": inventory_id,
255 "full_inventory": read_single(self._name, inventory_id, 'type') == 'full'
256 }
239 wiz_id = create(wiz_model, wiz_values)257 wiz_id = create(wiz_model, wiz_values)
240 context['wizard_id'] = wiz_id258 context['wizard_id'] = wiz_id
241259
242260
=== modified file 'bin/addons/stock/physical_inventory_view.xml'
--- bin/addons/stock/physical_inventory_view.xml 2020-11-30 15:46:46 +0000
+++ bin/addons/stock/physical_inventory_view.xml 2022-06-27 14:49:29 +0000
@@ -25,18 +25,17 @@
25 <field name="date" attrs="{'readonly': [('state', '!=', 'draft')]}"/>25 <field name="date" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
26 <field name="responsible"/>26 <field name="responsible"/>
27 <field name="date_done"/>27 <field name="date_done"/>
28 <field name="full_inventory"/>28 <field name="type" attrs="{'readonly': ['|', ('state', '!=', 'draft'), ('products_added', '=', True)]}"/>
29 <field name="discrepancies_generated" invisible="1" readonly="1"/>29 <field name="discrepancies_generated" invisible="1" readonly="1"/>
30 <button colspan="2" name="set_full_inventory" states="draft" string="Set as full inventory" type="object"30 <field name="max_filter_months" invisible="1"/>
31 icon="gtk-about" 31 <field name="multiple_filter_months" invisible="1"/>
32 confirm="Setting as 'full inventory' is irreversible. Do you confirm ?" 32 <field name="products_added" invisible="1" readonly="1"/>
33 attrs="{'invisible': [('full_inventory', '=', True)]}"/>
34 <notebook colspan="4">33 <notebook colspan="4">
35 <page string="Products" attrs="{'readonly': [('state', 'not in', ['draft'])]}">34 <page string="Products" attrs="{'readonly': [('state', 'not in', ['draft'])]}">
36 <button name="action_select_products" states="draft" string="Products Selection" type="object"35 <button name="action_select_products" states="draft" string="Products Selection" type="object"
37 icon="gtk-add"/>36 icon="gtk-add" attrs="{'invisible': [('type', '=', 'correction')]}"/>
38 <field colspan="4" name="product_ids" nolabel="1" 37 <field colspan="4" name="product_ids" nolabel="1" on_change="onchange_products(product_ids)"
39 attrs="{'readonly': ['|', ('full_inventory', '=', True), ('state', 'not in', ['draft'])]}">38 attrs="{'readonly': ['|', ('type', '=', 'full'), ('state', '!=', 'draft')]}">
40 <tree string="Products" noteditable="1">39 <tree string="Products" noteditable="1">
41 <field name="default_code"/>40 <field name="default_code"/>
42 <field name="name"/>41 <field name="name"/>
4342
=== modified file 'bin/addons/stock/wizard/physical_inventory_select_products.py'
--- bin/addons/stock/wizard/physical_inventory_select_products.py 2021-08-16 15:44:14 +0000
+++ bin/addons/stock/wizard/physical_inventory_select_products.py 2022-06-27 14:49:29 +0000
@@ -393,7 +393,7 @@
393 product_ids = self.pool.get("product.product").search(cr, uid, [("id", 'in', product_ids)], context=context)393 product_ids = self.pool.get("product.product").search(cr, uid, [("id", 'in', product_ids)], context=context)
394394
395 # '6' is the code for 'replace all'395 # '6' is the code for 'replace all'
396 vals = {'product_ids': [(6, 0, product_ids)]}396 vals = {'product_ids': [(6, 0, product_ids)], 'products_added': True}
397397
398 # Check if 'recent_movements' has been used398 # Check if 'recent_movements' has been used
399 if wiz_data['products_preview'] and (wiz_data['first_filter'] == 'recent_movements' or wiz_data['full_inventory'] and wiz_data['recent_moves_months_fullinvo']):399 if wiz_data['products_preview'] and (wiz_data['first_filter'] == 'recent_movements' or wiz_data['full_inventory'] and wiz_data['recent_moves_months_fullinvo']):

Subscribers

People subscribed via source and target branches