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

Proposed by jftempo
Status: Merged
Merged at revision: 6274
Proposed branch: lp:~dorian-kemps/unifield-server/US-7323
Merge into: lp:unifield-server
Diff against target: 879 lines (+408/-59) (has conflicts)
19 files modified
bin/addons/base/ir/ir_actions.py (+2/-0)
bin/addons/base/ir/ir_values.py (+14/-2)
bin/addons/msf_outgoing/msf_outgoing_view.xml (+3/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+37/-14)
bin/addons/procurement_request/procurement_request_view.xml (+13/-14)
bin/addons/product/product.py (+21/-0)
bin/addons/product_attributes/product_attributes_view.xml (+190/-16)
bin/addons/purchase/purchase_order.py (+15/-3)
bin/addons/purchase/purchase_view.xml (+0/-6)
bin/addons/reason_types_moves/reason_type_view.xml (+1/-0)
bin/addons/reason_types_moves/stock_view.xml (+1/-0)
bin/addons/sale/sale_order.py (+35/-1)
bin/addons/sale/sale_view.xml (+2/-0)
bin/addons/stock/stock.py (+35/-0)
bin/addons/stock/stock_view.xml (+1/-0)
bin/addons/tender_flow/tender_flow.py (+35/-1)
bin/addons/tender_flow/tender_flow_view.xml (+1/-1)
bin/import_xml.rng (+1/-0)
bin/tools/convert.py (+1/-1)
Text conflict in bin/addons/msf_profile/i18n/fr_MF.po
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-7323
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+424784@code.launchpad.net
To post a comment you must log in.
6248. By Dorian

US-7323 [FIX] Product: Added the search view to the docs' actions to have the correct filters

6249. By Dorian

US-7323 [FIX] Product: Replaced the act_windows by ir.actions.server to lose no views, domain or context while using the actions on the right menu

6250. By Dorian

US-7323 [MERGE] Merge with jfb-tempo-consulting/unifield-server/US-7323

6251. By Dorian

US-7323 [FIX] Product: The right menu actions for the docs put the product_id in the context (and the search filter in the view) instead of the domain

6252. By Dorian

US-7323 [FIX] IR filters: Removed a group in the view to have access to more width

6253. By Dorian

US-7323 [FIX] Product: Removed the product name from the new search views generated by the docs button on the right menu

6254. By Dorian

US-7323 [FIX] Product right menu: the new docs ations will put no default filter on the generated view expect for the product_id

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/addons/base/ir/ir_actions.py'
--- bin/addons/base/ir/ir_actions.py 2021-10-12 16:20:20 +0000
+++ bin/addons/base/ir/ir_actions.py 2022-07-13 15:38:28 +0000
@@ -373,6 +373,8 @@
373 if not new_tab:373 if not new_tab:
374 res['target'] = 'crush'374 res['target'] = 'crush'
375 return res375 return res
376
377
376act_window()378act_window()
377379
378class act_window_view(osv.osv):380class act_window_view(osv.osv):
379381
=== modified file 'bin/addons/base/ir/ir_values.py'
--- bin/addons/base/ir/ir_values.py 2021-08-20 10:32:29 +0000
+++ bin/addons/base/ir/ir_values.py 2022-07-13 15:38:28 +0000
@@ -237,11 +237,23 @@
237 # for the admin only add the "Update Sent / Received" links in the menu on the right for all synched objects237 # for the admin only add the "Update Sent / Received" links in the menu on the right for all synched objects
238 if key == 'action' and key2 == 'client_action_relate' and uid == 1 and self.pool.get('update.link') and models:238 if key == 'action' and key2 == 'client_action_relate' and uid == 1 and self.pool.get('update.link') and models:
239 obj_model = models[0][0]239 obj_model = models[0][0]
240 act_to_add = []
240 if self.pool.get('sync.client.rule').search_exist(cr, uid, [('model', '=', obj_model), ('type', '!=', 'USB')]):241 if self.pool.get('sync.client.rule').search_exist(cr, uid, [('model', '=', obj_model), ('type', '!=', 'USB')]):
241 act_sent_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sync_client', 'action_open_updates_sent')[1]242 act_sent_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sync_client', 'action_open_updates_sent')[1]
242 result.append((act_sent_id, 'Updates_Sent', u'ir.actions.server,%d' % act_sent_id, True, None, u'action'))243 act_to_add.append((act_sent_id, 'Updates_Sent', u'ir.actions.server,%d' % act_sent_id, True, None, u'action'))
243 act_rcv_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sync_client', 'action_open_updates_received')[1]244 act_rcv_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sync_client', 'action_open_updates_received')[1]
244 result.append((act_rcv_id, 'Updates_Received', u'ir.actions.server,%d' % act_rcv_id, True, None, u'action'))245 act_to_add.append((act_rcv_id, 'Updates_Received', u'ir.actions.server,%d' % act_rcv_id, True, None, u'action'))
246
247 if obj_model == 'product.product':
248 # on product updates links are not at the end
249 new_res = []
250 for x in result:
251 new_res.append(x)
252 if x[1] == u'View_log_product.product':
253 new_res += act_to_add
254 result = new_res
255 else:
256 result += act_to_add
245257
246 if not result:258 if not result:
247 return []259 return []
248260
=== modified file 'bin/addons/msf_outgoing/msf_outgoing_view.xml'
--- bin/addons/msf_outgoing/msf_outgoing_view.xml 2022-03-09 10:33:36 +0000
+++ bin/addons/msf_outgoing/msf_outgoing_view.xml 2022-07-13 15:38:28 +0000
@@ -467,6 +467,7 @@
467 <field name="reason_type_id" widget="selection" domain="[('outgoing_ok', '=', True)]" />467 <field name="reason_type_id" widget="selection" domain="[('outgoing_ok', '=', True)]" />
468 <field name="date" />468 <field name="date" />
469 <field name="min_date" />469 <field name="min_date" />
470 <field name="product_id" />
470 </group>471 </group>
471 <newline />472 <newline />
472 <group string="State of lines" col="8" colspan="4">473 <group string="State of lines" col="8" colspan="4">
@@ -803,8 +804,10 @@
803 <field name="order_category" />804 <field name="order_category" />
804 <field name="reason_type_id" widget="selection" />805 <field name="reason_type_id" widget="selection" />
805 <field name="company_id" widget="selection" groups="base.group_multi_company"/>806 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
807 <newline/>
806 <field name="date" />808 <field name="date" />
807 <field name="min_date" />809 <field name="min_date" />
810 <field name="product_id" />
808 </group>811 </group>
809 <newline/>812 <newline/>
810 <group expand="0" string="Group By..." colspan="4" col="8">813 <group expand="0" string="Group By..." colspan="4" col="8">
811814
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2022-07-11 08:43:43 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2022-07-13 15:38:28 +0000
@@ -10568,11 +10568,12 @@
10568msgid "Lists/Sublists"10568msgid "Lists/Sublists"
10569msgstr "Listes/Sous-listes"10569msgstr "Listes/Sous-listes"
1057010570
10571#. modules: sale, useability_dashboard_and_menu10571#. modules: sale, useability_dashboard_and_menu, product_attributes
10572#: view:sale.report:010572#: view:sale.report:0
10573#: view:sale.order:010573#: view:sale.order:0
10574#: model:ir.actions.server,name:product_attributes.action_product_fo_tree
10574msgid "Field Orders"10575msgid "Field Orders"
10575msgstr "Commandes du terrain"10576msgstr "Commandes de Terrain"
1057610577
10577#. modules: purchase_msf, purchase_override10578#. modules: purchase_msf, purchase_override
10578#: field:purchase.order.line,internal_name:010579#: field:purchase.order.line,internal_name:0
@@ -12144,11 +12145,6 @@
12144msgid "Draft statement"12145msgid "Draft statement"
12145msgstr "Relevé sous statut brouillon"12146msgstr "Relevé sous statut brouillon"
1214612147
12147#. module: product_attributes
12148#: model:ir.actions.act_window,name:product_attributes.action_order_line_product_tree
12149msgid "Field orders"
12150msgstr "Commandes de terrain"
12151
12152#. module: tender_flow12148#. module: tender_flow
12153#: selection:tender,internal_state:012149#: selection:tender,internal_state:0
12154msgid "Rfq Updated"12150msgid "Rfq Updated"
@@ -17168,7 +17164,7 @@
17168msgstr "Employé - Etat civil "17164msgstr "Employé - Etat civil "
1716917165
17170#. modules: product_attributes, tender_flow, sales_followup17166#. modules: product_attributes, tender_flow, sales_followup
17171#: model:ir.actions.act_window,name:product_attributes.action_tender_product_tree17167#: model:ir.actions.server,name:product_attributes.action_product_tender_tree
17172#: view:sale.order.line.followup:017168#: view:sale.order.line.followup:0
17173#: model:ir.actions.act_window,name:tender_flow.tender_action17169#: model:ir.actions.act_window,name:tender_flow.tender_action
17174#: model:ir.ui.menu,name:tender_flow.menu_tender17170#: model:ir.ui.menu,name:tender_flow.menu_tender
@@ -23027,7 +23023,7 @@
23027msgid "Pacific/Easter"23023msgid "Pacific/Easter"
23028msgstr "Pacific/Easter"23024msgstr "Pacific/Easter"
2302923025
23030#. modules: purchase, msf_outgoing, useability_dashboard_and_menu, stock23026#. modules: purchase, msf_outgoing, useability_dashboard_and_menu, stock, product_attributes
23031#: view:purchase.order:023027#: view:purchase.order:0
23032#: model:ir.actions.act_window,name:stock.action_picking_tree23028#: model:ir.actions.act_window,name:stock.action_picking_tree
23033#: model:ir.ui.menu,name:stock.menu_action_picking_tree23029#: model:ir.ui.menu,name:stock.menu_action_picking_tree
@@ -23037,6 +23033,7 @@
23037#: code:addons/msf_outgoing/wizard/internal_move_processor.py:18523033#: code:addons/msf_outgoing/wizard/internal_move_processor.py:185
23038#: code:addons/msf_outgoing/wizard/internal_move_processor.py:20523034#: code:addons/msf_outgoing/wizard/internal_move_processor.py:205
23039#: code:addons/msf_outgoing/wizard/outgoing_delivery_processor.py:10423035#: code:addons/msf_outgoing/wizard/outgoing_delivery_processor.py:104
23036#: model:ir.actions.server,name:product_attributes.action_product_out_tree
23040#, python-format23037#, python-format
23041msgid "Delivery Orders"23038msgid "Delivery Orders"
23042msgstr "Bons de Livraison"23039msgstr "Bons de Livraison"
@@ -39331,9 +39328,10 @@
39331msgid "Cross-docking Val."39328msgid "Cross-docking Val."
39332msgstr "Transbordement - Valeur."39329msgstr "Transbordement - Valeur."
3933339330
39334#. module: tender_flow39331#. module: tender_flow, product_attributes
39335#: view:tender:039332#: view:tender:0
39336#: field:tender,rfq_ids:039333#: field:tender,rfq_ids:0
39334#: model:ir.actions.server,name:product_attributes.action_product_rfq_tree
39337msgid "RfQs"39335msgid "RfQs"
39338msgstr "DdD"39336msgstr "DdD"
3933939337
@@ -69281,7 +69279,7 @@
69281msgid "Display graph"69279msgid "Display graph"
69282msgstr "Affichage du Graphique"69280msgstr "Affichage du Graphique"
6928369281
69284#. modules: purchase, useability_dashboard_and_menu, stock, msf_outgoing69282#. modules: purchase, useability_dashboard_and_menu, stock, msf_outgoing, product_attributes
69285#: code:addons/msf_outgoing/wizard/internal_move_processor.py:18369283#: code:addons/msf_outgoing/wizard/internal_move_processor.py:183
69286#: model:ir.ui.menu,name:purchase.menu_action_picking_tree469284#: model:ir.ui.menu,name:purchase.menu_action_picking_tree4
69287#: model:ir.actions.act_window,name:stock.action_picking_tree469285#: model:ir.actions.act_window,name:stock.action_picking_tree4
@@ -69289,6 +69287,7 @@
69289#: view:stock.picking:069287#: view:stock.picking:0
69290#: view:board.board:069288#: view:board.board:0
69291#: model:ir.actions.act_window,name:useability_dashboard_and_menu.action_picking_tree_available69289#: model:ir.actions.act_window,name:useability_dashboard_and_menu.action_picking_tree_available
69290#: model:ir.actions.server,name:product_attributes.action_product_in_tree
69292#, python-format69291#, python-format
69293msgid "Incoming Shipments"69292msgid "Incoming Shipments"
69294msgstr "Livraisons Entrantes"69293msgstr "Livraisons Entrantes"
@@ -78816,12 +78815,13 @@
78816msgid "Subtotal (functional currency)"78815msgid "Subtotal (functional currency)"
78817msgstr "Sous-Total (devise fonctionnelle)"78816msgstr "Sous-Total (devise fonctionnelle)"
7881878817
78819#. modules: stock, msf_outgoing78818#. modules: stock, msf_outgoing, product_attributes
78820#: code:addons/msf_outgoing/wizard/internal_move_processor.py:18478819#: code:addons/msf_outgoing/wizard/internal_move_processor.py:184
78821#: model:ir.actions.act_window,name:stock.action_picking_tree678820#: model:ir.actions.act_window,name:stock.action_picking_tree6
78822#: model:ir.ui.menu,name:stock.menu_action_picking_tree678821#: model:ir.ui.menu,name:stock.menu_action_picking_tree6
78823#: view:stock.picking:078822#: view:stock.picking:0
78824#: field:stock.picking,move_lines:078823#: field:stock.picking,move_lines:0
78824#: model:ir.actions.server,name:product_attributes.action_product_int_tree
78825#, python-format78825#, python-format
78826msgid "Internal Moves"78826msgid "Internal Moves"
78827msgstr "Mouvements Internes"78827msgstr "Mouvements Internes"
@@ -79431,9 +79431,10 @@
79431msgid "You do not have access to the field (%s). If you did not edit this field, please let an OpenERP administrator know about this error message, and the field name."79431msgid "You do not have access to the field (%s). If you did not edit this field, please let an OpenERP administrator know about this error message, and the field name."
79432msgstr "You do not have access to the field (%s). If you did not edit this field, please let an OpenERP administrator know about this error message, and the field name."79432msgstr "You do not have access to the field (%s). If you did not edit this field, please let an OpenERP administrator know about this error message, and the field name."
7943379433
79434#. module: procurement_request79434#. module: procurement_request, product_attributes
79435#: model:ir.actions.act_window,name:procurement_request.action_procurement_request79435#: model:ir.actions.act_window,name:procurement_request.action_procurement_request
79436#: model:ir.ui.menu,name:procurement_request.menu_procurement_request79436#: model:ir.ui.menu,name:procurement_request.menu_procurement_request
79437#: model:ir.actions.server,name:product_attributes.action_product_ir_tree
79437#: view:sale.order:079438#: view:sale.order:0
79438msgid "Internal Requests"79439msgid "Internal Requests"
79439msgstr "Demandes Internes"79440msgstr "Demandes Internes"
@@ -82989,6 +82990,7 @@
82989#: field:view.expired.expiring.stock.lines,product_id:082990#: field:view.expired.expiring.stock.lines,product_id:0
82990#: field:account.commitment.line,line_product_id:082991#: field:account.commitment.line,line_product_id:0
82991#: field:product.ed_bn.mass.update.history,product_id:082992#: field:product.ed_bn.mass.update.history,product_id:0
82993#: field:stock.picking,product_id:0
82992#, python-format82994#, python-format
82993msgid "Product"82995msgid "Product"
82994msgstr "Produit"82996msgstr "Produit"
@@ -87933,7 +87935,7 @@
87933#: view:account.analytic.line:087935#: view:account.analytic.line:0
87934#: field:analytic.distribution,purchase_ids:087936#: field:analytic.distribution,purchase_ids:0
87935#: model:ir.ui.menu,name:base.menu_purchase_root87937#: model:ir.ui.menu,name:base.menu_purchase_root
87936#: model:ir.actions.act_window,name:purchase.action_purchase_line_product_tree287938#: model:ir.actions.server,name:product_attributes.action_product_po_tree
87937msgid "Purchases"87939msgid "Purchases"
87938msgstr "Achats"87940msgstr "Achats"
8793987941
@@ -115351,6 +115353,7 @@
115351#, python-format115353#, python-format
115352msgid "Cannot update these products, ED/BN attributes have not changed since the KCL creation"115354msgid "Cannot update these products, ED/BN attributes have not changed since the KCL creation"
115353msgstr "Impossible de mettre à jour ces produits. Les attributs NL/DE n'ont pas changé depuis la création du Kit"115355msgstr "Impossible de mettre à jour ces produits. Les attributs NL/DE n'ont pas changé depuis la création du Kit"
115356<<<<<<< TREE
115354115357
115355#. module: board115358#. module: board
115356#: report:addons/board/report/integrity.mako:83115359#: report:addons/board/report/integrity.mako:83
@@ -115652,3 +115655,23 @@
115652msgid "This report is an analysis done by employee. It is a report containing one line per employee representing the cumulative credit balance."115655msgid "This report is an analysis done by employee. It is a report containing one line per employee representing the cumulative credit balance."
115653msgstr "Ce rapport est une analyse effectuée par employé. Il s'agit d'un rapport contenant une ligne par employé et représentant le solde créditeur cumulé."115656msgstr "Ce rapport est une analyse effectuée par employé. Il s'agit d'un rapport contenant une ligne par employé et représentant le solde créditeur cumulé."
115654115657
115658=======
115659
115660#. modules: purchase, tender_flow, sale, stock
115661#: help:purchase.order,product_id:0
115662#: help:sale.order,product_id:0
115663#: help:stock.picking,product_id:0
115664#: help:tender,product_id:0
115665msgid "Product to find in the lines"
115666msgstr "Produit à trouver dans les lignes"
115667
115668#. module: product_attributes
115669#: model:ir.actions.server,name:product_attributes.action_product_pick_tree
115670msgid "Pickings"
115671msgstr "Pickings"
115672
115673#. module: product_attributes
115674#: model:ir.actions.server,name:product_attributes.action_product_pack_tree
115675msgid "Packings"
115676msgstr "Colisages"
115677>>>>>>> MERGE-SOURCE
115655115678
=== modified file 'bin/addons/procurement_request/procurement_request_view.xml'
--- bin/addons/procurement_request/procurement_request_view.xml 2022-05-18 11:32:30 +0000
+++ bin/addons/procurement_request/procurement_request_view.xml 2022-07-13 15:38:28 +0000
@@ -173,19 +173,18 @@
173 <field name="priority" eval="250" />173 <field name="priority" eval="250" />
174 <field name="arch" type="xml">174 <field name="arch" type="xml">
175 <search string="Internal Requests">175 <search string="Internal Requests">
176 <group string="Filters" expand="1">176 <filter name="state_proc" string="Draft" icon="terp-document-new" domain="[('state', 'in', ['draft','draft_p'])]" />
177 <filter name="state_proc" string="Draft" icon="terp-document-new" domain="[('state', 'in', ['draft','draft_p'])]" />177 <filter name="state_valid" string="Validated" icon="terp-check" domain="[('state', 'in', ['validated','validated_p'])]" />
178 <filter name="state_valid" string="Validated" icon="terp-check" domain="[('state', 'in', ['validated','validated_p'])]" />178 <filter name="sourced" string="Sourced" icon="gtk-paste-v" domain="[('state','in',['sourced','sourced_p'])]" />
179 <filter name="sourced" string="Sourced" icon="gtk-paste-v" domain="[('state','in',['sourced','sourced_p'])]" />179 <filter name="state_proc_progress" string="Confirmed" icon="terp-camera_test" domain="[('state', 'in', ('confirmed', 'confirmed_p'))]" />
180 <filter name="state_proc_progress" string="Confirmed" icon="terp-camera_test" domain="[('state', 'in', ('confirmed', 'confirmed_p'))]" />180 <filter name="state_done" string="Closed" icon="terp-dialog-close" domain="[('state', '=', 'done')]" />
181 <filter name="state_done" string="Closed" icon="terp-dialog-close" domain="[('state', '=', 'done')]" />181 <filter name="cancelled" string="Cancelled" icon="gtk-cancel" domain="[('state', '=', 'cancel')]" />
182 <filter name="cancelled" string="Cancelled" icon="gtk-cancel" domain="[('state', '=', 'cancel')]" />182 <separator orientation="vertical" />
183 <separator orientation="vertical" />183 <field name="name" />
184 <field name="name" />184 <field name="origin" />
185 <field name="origin" />185 <field name="requestor" />
186 <field name="requestor" />186 <field name="location_requestor_id" />
187 <field name="location_requestor_id" />187 <field name="product_id" />
188 </group>
189 <newline />188 <newline />
190 <group string="Group By...">189 <group string="Group By...">
191 <filter string="State" icon="terp-gtk-select-all" domain="[]" context="{'group_by': 'state'}" />190 <filter string="State" icon="terp-gtk-select-all" domain="[]" context="{'group_by': 'state'}" />
@@ -216,7 +215,7 @@
216 <field name="res_model">sale.order</field>215 <field name="res_model">sale.order</field>
217 <field name="view_type">form</field>216 <field name="view_type">form</field>
218 <field name="view_mode">tree,form</field>217 <field name="view_mode">tree,form</field>
219 <field name="view_search_id" ref="procurement_request_search_view" />218 <field name="search_view_id" ref="procurement_request_search_view" />
220 <field name="context">{'procurement_request': True}</field>219 <field name="context">{'procurement_request': True}</field>
221 <field name="domain">[('procurement_request', '=', True)]</field>220 <field name="domain">[('procurement_request', '=', True)]</field>
222 </record>221 </record>
223222
=== modified file 'bin/addons/product/product.py'
--- bin/addons/product/product.py 2021-08-06 15:49:01 +0000
+++ bin/addons/product/product.py 2022-07-13 15:38:28 +0000
@@ -27,6 +27,7 @@
27import re27import re
28from tools.translate import _28from tools.translate import _
29from tools import cache29from tools import cache
30from tools.safe_eval import safe_eval
3031
31def is_pair(x):32def is_pair(x):
32 return not x%233 return not x%2
@@ -893,9 +894,29 @@
893 res.update({'value': {'list_price': list_price}})894 res.update({'value': {'list_price': list_price}})
894 return res895 return res
895896
897 def view_docs_with_product(self, cr, uid, ids, menu_action, context=None):
898 '''
899 Get info from the given menu action to return the right view with the right data
900 '''
901
902 if context is None:
903 context = {}
904
905 res = self.pool.get('ir.actions.act_window').open_view_from_xmlid(cr, uid, menu_action, ['tree', 'form'], new_tab=True, context=context)
906
907 res_context = res.get('context', False) and safe_eval(res['context']) or {}
908 for col in res_context: # Remove the default filters
909 if 'search_default_' in col:
910 res_context[col] = False
911 res_context['search_default_product_id'] = context.get('active_id', False)
912 res['context'] = res_context
913
914 return res
915
896916
897product_product()917product_product()
898918
919
899class product_packaging(osv.osv):920class product_packaging(osv.osv):
900 _name = "product.packaging"921 _name = "product.packaging"
901 _description = "Packaging"922 _description = "Packaging"
902923
=== modified file 'bin/addons/product_attributes/product_attributes_view.xml'
--- bin/addons/product_attributes/product_attributes_view.xml 2021-12-07 15:12:27 +0000
+++ bin/addons/product_attributes/product_attributes_view.xml 2022-07-13 15:38:28 +0000
@@ -542,22 +542,196 @@
542 </field>542 </field>
543 </record>543 </record>
544544
545 <act_window545 <!-- List of actions at the bottom of the list, the dashed line-break is located on the web's side -->
546 context="{}"546 <!-- FO -->
547 domain="[('procurement_request', '=', False), ('product_id', '=', active_id)]"547 <record id="action_product_fo_tree" model="ir.actions.server">
548 id="action_order_line_product_tree"548 <field name="name">Field Orders</field>
549 name="Field orders"549 <field name="model_id" ref="product.model_product_product"/>
550 res_model="sale.order"550 <field name="state">code</field>
551 src_model="product.product" />551 <field name="code">
552552action = self.view_docs_with_product(cr, uid, ids, menu_action='sale.action_order_form', context=context)
553 <act_window553 </field>
554 context="{}"554 </record>
555 domain="[('product_id', '=', active_id)]"555
556 id="action_tender_product_tree"556 <record id="open_product_fo_tree" model="ir.values">
557 name="Tenders"557 <field name="key2">client_action_relate</field>
558 res_model="tender"558 <field name="model">product.product</field>
559 src_model="product.product" />559 <field name="name">Field Orders</field>
560560 <field name="value" eval="'ir.actions.server,%d'%action_product_fo_tree"/>
561 <field name="object" eval="True"/>
562 <field name="sequence" eval="100001"/>
563 </record>
564
565 <!-- IR -->
566 <record id="action_product_ir_tree" model="ir.actions.server">
567 <field name="name">Internal Requests</field>
568 <field name="model_id" ref="product.model_product_product"/>
569 <field name="state">code</field>
570 <field name="code">
571action = self.view_docs_with_product(cr, uid, ids, menu_action='procurement_request.action_procurement_request', context=context)
572 </field>
573 </record>
574
575 <record id="open_product_ir_tree" model="ir.values">
576 <field name="key2">client_action_relate</field>
577 <field name="model">product.product</field>
578 <field name="name">Internal Requests</field>
579 <field name="value" eval="'ir.actions.server,%d'%action_product_ir_tree"/>
580 <field name="object" eval="True"/>
581 <field name="sequence" eval="100002"/>
582 </record>
583
584 <!-- PO -->
585 <record id="action_product_po_tree" model="ir.actions.server">
586 <field name="name">Purchases</field>
587 <field name="model_id" ref="product.model_product_product"/>
588 <field name="state">code</field>
589 <field name="code">
590action = self.view_docs_with_product(cr, uid, ids, menu_action='purchase.purchase_form_action', context=context)
591 </field>
592 </record>
593
594 <record id="open_product_po_tree" model="ir.values">
595 <field name="key2">client_action_relate</field>
596 <field name="model">product.product</field>
597 <field name="name">Purchases</field>
598 <field name="value" eval="'ir.actions.server,%d'%action_product_po_tree"/>
599 <field name="object" eval="True"/>
600 <field name="sequence" eval="100003"/>
601 </record>
602
603 <!-- RfQ -->
604 <record id="action_product_rfq_tree" model="ir.actions.server">
605 <field name="name">RfQs</field>
606 <field name="model_id" ref="product.model_product_product"/>
607 <field name="state">code</field>
608 <field name="code">
609action = self.view_docs_with_product(cr, uid, ids, menu_action='purchase.purchase_rfq', context=context)
610 </field>
611 </record>
612
613 <record id="open_product_rfq_tree" model="ir.values">
614 <field name="key2">client_action_relate</field>
615 <field name="model">product.product</field>
616 <field name="name">RfQs</field>
617 <field name="value" eval="'ir.actions.server,%d'%action_product_rfq_tree"/>
618 <field name="object" eval="True"/>
619 <field name="sequence" eval="100004"/>
620 </record>
621
622 <!-- Tender -->
623 <record id="action_product_tender_tree" model="ir.actions.server">
624 <field name="name">Tenders</field>
625 <field name="model_id" ref="product.model_product_product"/>
626 <field name="state">code</field>
627 <field name="code">
628action = self.view_docs_with_product(cr, uid, ids, menu_action='tender_flow.tender_action', context=context)
629 </field>
630 </record>
631
632 <record id="open_product_tender_tree" model="ir.values">
633 <field name="key2">client_action_relate</field>
634 <field name="model">product.product</field>
635 <field name="name">Tenders</field>
636 <field name="value" eval="'ir.actions.server,%d'%action_product_tender_tree"/>
637 <field name="object" eval="True"/>
638 <field name="sequence" eval="100005"/>
639 </record>
640
641 <!-- IN -->
642 <record id="action_product_in_tree" model="ir.actions.server">
643 <field name="name">Incoming Shipments</field>
644 <field name="model_id" ref="product.model_product_product"/>
645 <field name="state">code</field>
646 <field name="code">
647action = self.view_docs_with_product(cr, uid, ids, menu_action='stock.action_picking_tree4', context=context)
648 </field>
649 </record>
650
651 <record id="open_product_in_tree" model="ir.values">
652 <field name="key2">client_action_relate</field>
653 <field name="model">product.product</field>
654 <field name="name">Incoming Shipments</field>
655 <field name="value" eval="'ir.actions.server,%d'%action_product_in_tree"/>
656 <field name="object" eval="True"/>
657 <field name="sequence" eval="100006"/>
658 </record>
659
660 <!-- INT -->
661 <record id="action_product_int_tree" model="ir.actions.server">
662 <field name="name">Internal Moves</field>
663 <field name="model_id" ref="product.model_product_product"/>
664 <field name="state">code</field>
665 <field name="code">
666action = self.view_docs_with_product(cr, uid, ids, menu_action='stock.action_picking_tree6', context=context)
667 </field>
668 </record>
669
670 <record id="open_product_int_tree" model="ir.values">
671 <field name="key2">client_action_relate</field>
672 <field name="model">product.product</field>
673 <field name="name">Internal Moves</field>
674 <field name="value" eval="'ir.actions.server,%d'%action_product_int_tree"/>
675 <field name="object" eval="True"/>
676 <field name="sequence" eval="100007"/>
677 </record>
678
679 <!-- OUT -->
680 <record id="action_product_out_tree" model="ir.actions.server">
681 <field name="name">Delivery Orders</field>
682 <field name="model_id" ref="product.model_product_product"/>
683 <field name="state">code</field>
684 <field name="code">
685action = self.view_docs_with_product(cr, uid, ids, menu_action='stock.action_picking_tree', context=context)
686 </field>
687 </record>
688
689 <record id="open_product_out_tree" model="ir.values">
690 <field name="key2">client_action_relate</field>
691 <field name="model">product.product</field>
692 <field name="name">Delivery Orders</field>
693 <field name="value" eval="'ir.actions.server,%d'%action_product_out_tree"/>
694 <field name="object" eval="True"/>
695 <field name="sequence" eval="100008"/>
696 </record>
697
698 <!-- Pick -->
699 <record id="action_product_pick_tree" model="ir.actions.server">
700 <field name="name">Pickings</field>
701 <field name="model_id" ref="product.model_product_product"/>
702 <field name="state">code</field>
703 <field name="code">
704action = self.view_docs_with_product(cr, uid, ids, menu_action='msf_outgoing.action_picking_ticket', context=context)
705 </field>
706 </record>
707
708 <record id="open_product_pick_tree" model="ir.values">
709 <field name="key2">client_action_relate</field>
710 <field name="model">product.product</field>
711 <field name="name">Pickings</field>
712 <field name="value" eval="'ir.actions.server,%d'%action_product_pick_tree"/>
713 <field name="object" eval="True"/>
714 <field name="sequence" eval="100009"/>
715 </record>
716
717 <!-- PPL -->
718 <record id="action_product_pack_tree" model="ir.actions.server">
719 <field name="name">Packings</field>
720 <field name="model_id" ref="product.model_product_product"/>
721 <field name="state">code</field>
722 <field name="code">
723action = self.view_docs_with_product(cr, uid, ids, menu_action='msf_outgoing.action_ppl', context=context)
724 </field>
725 </record>
726
727 <record id="open_product_pack_tree" model="ir.values">
728 <field name="key2">client_action_relate</field>
729 <field name="model">product.product</field>
730 <field name="name">Packings</field>
731 <field name="value" eval="'ir.actions.server,%d'%action_product_pack_tree"/>
732 <field name="object" eval="True"/>
733 <field name="sequence" eval="100010"/>
734 </record>
561735
562 <!-- Add a link to see all inactivated products -->736 <!-- Add a link to see all inactivated products -->
563 <act_window737 <act_window
564738
=== modified file 'bin/addons/purchase/purchase_order.py'
--- bin/addons/purchase/purchase_order.py 2022-03-22 09:01:13 +0000
+++ bin/addons/purchase/purchase_order.py 2022-07-13 15:38:28 +0000
@@ -54,9 +54,12 @@
54 '''54 '''
55 new_dom = []55 new_dom = []
56 dest_partner_names = False56 dest_partner_names = False
57 product_id = False
57 for x in domain:58 for x in domain:
58 if x[0] == 'dest_partner_names':59 if x[0] == 'dest_partner_names':
59 dest_partner_names = x[2]60 dest_partner_names = x[2]
61 elif x[0] == 'product_id':
62 product_id = x[2]
60 else:63 else:
61 new_dom.append(x)64 new_dom.append(x)
6265
@@ -72,6 +75,12 @@
72 ret.where_clause.append(' "res_partner"."name" ilike %s ')75 ret.where_clause.append(' "res_partner"."name" ilike %s ')
73 ret.where_clause_params.append('%%%s%%'%dest_partner_names)76 ret.where_clause_params.append('%%%s%%'%dest_partner_names)
74 ret.having_group_by = ' GROUP BY "purchase_order"."id" '77 ret.having_group_by = ' GROUP BY "purchase_order"."id" '
78 if product_id and isinstance(product_id, int):
79 ret.tables.append('"purchase_order_line"')
80 ret.joins.setdefault('"purchase_order"', [])
81 ret.joins['"purchase_order"'] += [('"purchase_order_line"', 'id', 'order_id', 'LEFT JOIN')]
82 ret.where_clause.append(''' "purchase_order_line"."product_id" = %s ''')
83 ret.where_clause_params.append(product_id)
75 return ret84 return ret
7685
77 def _amount_all(self, cr, uid, ids, field_name, arg, context=None):86 def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
@@ -708,9 +717,13 @@
708717
709 def _get_fake(self, cr, uid, ids, name, arg, context=None):718 def _get_fake(self, cr, uid, ids, name, arg, context=None):
710 """719 """
711 Fake method for 'has_confirmed_line' field720 Fake method for 'has_confirmed_line', 'has_confirmed_or_further_line' and 'product_id' fields
712 """721 """
713 res = {}722 res = {}
723 if not ids:
724 return res
725 if isinstance(ids, (int, long)):
726 ids = [ids]
714 for po_id in ids:727 for po_id in ids:
715 res[po_id] = False728 res[po_id] = False
716 return res729 return res
@@ -806,7 +819,6 @@
806819
807 return ret820 return ret
808821
809
810 _columns = {822 _columns = {
811 'order_type': fields.selection(ORDER_TYPES_SELECTION, string='Order Type', required=True),823 'order_type': fields.selection(ORDER_TYPES_SELECTION, string='Order Type', required=True),
812 'loan_id': fields.many2one('sale.order', string='Linked loan', readonly=True),824 'loan_id': fields.many2one('sale.order', string='Linked loan', readonly=True),
@@ -841,7 +853,7 @@
841 'unallocation_ok': fields.boolean(string='Unallocated PO'),853 'unallocation_ok': fields.boolean(string='Unallocated PO'),
842 'partner_ref': fields.char('Supplier Reference', size=128),854 'partner_ref': fields.char('Supplier Reference', size=128),
843 'short_partner_ref': fields.function(_get_short_partner_ref, method=True, string='Supplier Reference', type='char', size=64, store=False),855 'short_partner_ref': fields.function(_get_short_partner_ref, method=True, string='Supplier Reference', type='char', size=64, store=False),
844 'product_id': fields.related('order_line', 'product_id', type='many2one', relation='product.product', string='Product'),856 'product_id': fields.function(_get_fake, method=True, type='many2one', relation='product.product', string='Product', help='Product to find in the lines', store=False, readonly=True),
845 'no_line': fields.function(_get_no_line, method=True, type='boolean', string='No line'),857 'no_line': fields.function(_get_no_line, method=True, type='boolean', string='No line'),
846 'active': fields.boolean('Active', readonly=True),858 'active': fields.boolean('Active', readonly=True),
847 'po_from_ir': fields.function(_po_from_x, method=True, type='boolean', string='Is PO from IR ?', multi='po_from_x'),859 'po_from_ir': fields.function(_po_from_x, method=True, type='boolean', string='Is PO from IR ?', multi='po_from_x'),
848860
=== modified file 'bin/addons/purchase/purchase_view.xml'
--- bin/addons/purchase/purchase_view.xml 2022-06-14 11:28:55 +0000
+++ bin/addons/purchase/purchase_view.xml 2022-07-13 15:38:28 +0000
@@ -1015,12 +1015,6 @@
1015 </field>1015 </field>
1016 </record>1016 </record>
10171017
1018
1019 <act_window context="{}"
1020 domain="[('rfq_ok', '=', False), ('product_id', '=', active_id)]"
1021 id="purchase.action_purchase_line_product_tree2" name="Purchases"
1022 res_model="purchase.order" src_model="product.product" groups=""/>
1023
1024 <record id="purchase_line_form_action2" model="ir.actions.act_window">1018 <record id="purchase_line_form_action2" model="ir.actions.act_window">
1025 <field name="name">Purchase Lines Not Invoiced</field>1019 <field name="name">Purchase Lines Not Invoiced</field>
1026 <field name="type">ir.actions.act_window</field>1020 <field name="type">ir.actions.act_window</field>
10271021
=== modified file 'bin/addons/reason_types_moves/reason_type_view.xml'
--- bin/addons/reason_types_moves/reason_type_view.xml 2020-02-06 15:20:20 +0000
+++ bin/addons/reason_types_moves/reason_type_view.xml 2022-07-13 15:38:28 +0000
@@ -196,6 +196,7 @@
196 <newline />196 <newline />
197 <field name="date" />197 <field name="date" />
198 <field name="min_date" />198 <field name="min_date" />
199 <field name="product_id" />
199 </xpath>200 </xpath>
200 <xpath expr="/search//field[@name='company_id']" position="replace" />201 <xpath expr="/search//field[@name='company_id']" position="replace" />
201 <xpath expr="/search//filter[@name='done']" position="attributes">202 <xpath expr="/search//filter[@name='done']" position="attributes">
202203
=== modified file 'bin/addons/reason_types_moves/stock_view.xml'
--- bin/addons/reason_types_moves/stock_view.xml 2021-12-20 15:55:25 +0000
+++ bin/addons/reason_types_moves/stock_view.xml 2022-07-13 15:38:28 +0000
@@ -157,6 +157,7 @@
157 <field name="date" string="Creation date" />157 <field name="date" string="Creation date" />
158 <field name="min_date" string="Expected date" />158 <field name="min_date" string="Expected date" />
159 <field name="shipment_ref" />159 <field name="shipment_ref" />
160 <field name="product_id" />
160 </group>161 </group>
161 <newline/>162 <newline/>
162 <group expand="0" string="Group By..." colspan="4" col="8">163 <group expand="0" string="Group By..." colspan="4" col="8">
163164
=== modified file 'bin/addons/sale/sale_order.py'
--- bin/addons/sale/sale_order.py 2022-06-20 12:17:27 +0000
+++ bin/addons/sale/sale_order.py 2022-07-13 15:38:28 +0000
@@ -61,6 +61,27 @@
61 _name = "sale.order"61 _name = "sale.order"
62 _description = "Sales Order"62 _description = "Sales Order"
6363
64 def _where_calc(self, cr, uid, domain, active_test=True, context=None):
65 '''
66 overwrite to allow search on customer and self instance
67 '''
68 new_dom = []
69 product_id = False
70 for x in domain:
71 if x[0] == 'product_id':
72 product_id = x[2]
73 else:
74 new_dom.append(x)
75
76 ret = super(sale_order, self)._where_calc(cr, uid, new_dom, active_test=active_test, context=context)
77 if product_id and isinstance(product_id, int):
78 ret.tables.append('"sale_order_line"')
79 ret.joins.setdefault('"sale_order"', [])
80 ret.joins['"sale_order"'] += [('"sale_order_line"', 'id', 'order_id', 'LEFT JOIN')]
81 ret.where_clause.append(''' "sale_order_line"."product_id" = %s ''')
82 ret.where_clause_params.append(product_id)
83 return ret
84
64 def copy(self, cr, uid, id, default=None, context=None):85 def copy(self, cr, uid, id, default=None, context=None):
65 """86 """
66 Copy the sale.order. When copy the sale.order:87 Copy the sale.order. When copy the sale.order:
@@ -598,6 +619,19 @@
598619
599 return ret620 return ret
600621
622 def _get_fake(self, cr, uid, ids, name, args, context=None):
623 '''
624 Fake method for 'product_id' field
625 '''
626 res = {}
627 if not ids:
628 return res
629 if isinstance(ids, (int, long)):
630 ids = [ids]
631 for id in ids:
632 res[id] = False
633 return res
634
601 _columns = {635 _columns = {
602 'name': fields.char('Order Reference', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}, select=True, sort_column='id'),636 'name': fields.char('Order Reference', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}, select=True, sort_column='id'),
603 'origin': fields.char('Source Document', size=512, help="Reference of the document that generated this sales order request."),637 'origin': fields.char('Source Document', size=512, help="Reference of the document that generated this sales order request."),
@@ -694,7 +728,7 @@
694 'split_type_sale_order': fields.selection(SALE_ORDER_SPLIT_SELECTION, required=True, readonly=True, internal=1),728 'split_type_sale_order': fields.selection(SALE_ORDER_SPLIT_SELECTION, required=True, readonly=True, internal=1),
695 'original_so_id_sale_order': fields.many2one('sale.order', 'Original Field Order', readonly=True),729 'original_so_id_sale_order': fields.many2one('sale.order', 'Original Field Order', readonly=True),
696 'active': fields.boolean('Active', readonly=True),730 'active': fields.boolean('Active', readonly=True),
697 'product_id': fields.related('order_line', 'product_id', type='many2one', relation='product.product', string='Product'),731 'product_id': fields.function(_get_fake, method=True, type='many2one', relation='product.product', string='Product', help='Product to find in the lines', store=False, readonly=True),
698 'no_line': fields.function(_get_no_line, method=True, type='boolean', string='No line'),732 'no_line': fields.function(_get_no_line, method=True, type='boolean', string='No line'),
699 'manually_corrected': fields.function(_get_manually_corrected, method=True, type='boolean', string='Manually corrected'),733 'manually_corrected': fields.function(_get_manually_corrected, method=True, type='boolean', string='Manually corrected'),
700 'is_a_counterpart': fields.boolean('Counterpart?', help="This field is only for indicating that the order is a counterpart"),734 'is_a_counterpart': fields.boolean('Counterpart?', help="This field is only for indicating that the order is a counterpart"),
701735
=== modified file 'bin/addons/sale/sale_view.xml'
--- bin/addons/sale/sale_view.xml 2022-05-17 14:21:03 +0000
+++ bin/addons/sale/sale_view.xml 2022-07-13 15:38:28 +0000
@@ -504,6 +504,8 @@
504 <filter domain="[('user_id','=',uid)]" help="My Sale Orders" icon="terp-personal"/>504 <filter domain="[('user_id','=',uid)]" help="My Sale Orders" icon="terp-personal"/>
505 </field>505 </field>
506 <newline />506 <newline />
507 <field name="product_id" />
508 <newline />
507 <group string="Type" expand="0">509 <group string="Type" expand="0">
508 <filter icon="terp-check" string="Regular" domain="[('order_type','=','regular')]"/>510 <filter icon="terp-check" string="Regular" domain="[('order_type','=','regular')]"/>
509 <filter icon="terp-stage" string="Donation before expiry" domain="[('order_type','=','donation_exp')]"/>511 <filter icon="terp-stage" string="Donation before expiry" domain="[('order_type','=','donation_exp')]"/>
510512
=== modified file 'bin/addons/stock/stock.py'
--- bin/addons/stock/stock.py 2022-05-02 15:04:12 +0000
+++ bin/addons/stock/stock.py 2022-07-13 15:38:28 +0000
@@ -746,6 +746,27 @@
746 _name = "stock.picking"746 _name = "stock.picking"
747 _description = "Picking List"747 _description = "Picking List"
748748
749 def _where_calc(self, cr, uid, domain, active_test=True, context=None):
750 '''
751 overwrite to allow search on customer and self instance
752 '''
753 new_dom = []
754 product_id = False
755 for x in domain:
756 if x[0] == 'product_id':
757 product_id = x[2]
758 else:
759 new_dom.append(x)
760
761 ret = super(stock_picking, self)._where_calc(cr, uid, new_dom, active_test=active_test, context=context)
762 if product_id and isinstance(product_id, int):
763 ret.tables.append('"stock_move"')
764 ret.joins.setdefault('"stock_picking"', [])
765 ret.joins['"stock_picking"'] += [('"stock_move"', 'id', 'picking_id', 'LEFT JOIN')]
766 ret.where_clause.append(''' "stock_move"."product_id" = %s ''')
767 ret.where_clause_params.append(product_id)
768 return ret
769
749 def _set_maximum_date(self, cr, uid, ids, name, value, arg, context=None):770 def _set_maximum_date(self, cr, uid, ids, name, value, arg, context=None):
750 """ Calculates planned date if it is greater than 'value'.771 """ Calculates planned date if it is greater than 'value'.
751 @param name: Name of field772 @param name: Name of field
@@ -893,6 +914,19 @@
893914
894 return res915 return res
895916
917 def _get_fake(self, cr, uid, ids, name, args, context=None):
918 '''
919 Fake method for 'product_id' field
920 '''
921 res = {}
922 if not ids:
923 return res
924 if isinstance(ids, (int, long)):
925 ids = [ids]
926 for id in ids:
927 res[id] = False
928 return res
929
896 _columns = {930 _columns = {
897 'object_name': fields.function(_get_object_name, type='char', method=True, string='Title'),931 'object_name': fields.function(_get_object_name, type='char', method=True, string='Title'),
898 'name': fields.char('Reference', size=64, select=True),932 'name': fields.char('Reference', size=64, select=True),
@@ -952,6 +986,7 @@
952 'customers': fields.char('Customers', size=1026),986 'customers': fields.char('Customers', size=1026),
953 'customer_ref': fields.char('Customer Ref.', size=1026),987 'customer_ref': fields.char('Customer Ref.', size=1026),
954 'sync_dpo_in': fields.boolean('Synced IN for DPO reception', internal=1, help='Used to flag a IN linked to a DPO'),988 'sync_dpo_in': fields.boolean('Synced IN for DPO reception', internal=1, help='Used to flag a IN linked to a DPO'),
989 'product_id': fields.function(_get_fake, method=True, type='many2one', relation='product.product', string='Product', help='Product to find in the lines', store=False, readonly=True),
955 }990 }
956991
957 _defaults = {992 _defaults = {
958993
=== modified file 'bin/addons/stock/stock_view.xml'
--- bin/addons/stock/stock_view.xml 2021-11-17 15:46:45 +0000
+++ bin/addons/stock/stock_view.xml 2022-07-13 15:38:28 +0000
@@ -1003,6 +1003,7 @@
1003 <field name="origin"/>1003 <field name="origin"/>
1004 <field name="stock_journal_id" groups="base.group_extended" widget="selection"/>1004 <field name="stock_journal_id" groups="base.group_extended" widget="selection"/>
1005 <field name="company_id" widget="selection"/>1005 <field name="company_id" widget="selection"/>
1006 <field name="product_id"/>
1006 </group>1007 </group>
1007 <newline/>1008 <newline/>
1008 <group expand="0" string="Group By..." colspan="4" col="8">1009 <group expand="0" string="Group By..." colspan="4" col="8">
10091010
=== modified file 'bin/addons/tender_flow/tender_flow.py'
--- bin/addons/tender_flow/tender_flow.py 2022-03-21 12:41:58 +0000
+++ bin/addons/tender_flow/tender_flow.py 2022-07-13 15:38:28 +0000
@@ -41,6 +41,27 @@
41 _description = 'Tender'41 _description = 'Tender'
42 _trace = True42 _trace = True
4343
44 def _where_calc(self, cr, uid, domain, active_test=True, context=None):
45 '''
46 overwrite to allow search on customer and self instance
47 '''
48 new_dom = []
49 product_id = False
50 for x in domain:
51 if x[0] == 'product_id':
52 product_id = x[2]
53 else:
54 new_dom.append(x)
55
56 ret = super(tender, self)._where_calc(cr, uid, new_dom, active_test=active_test, context=context)
57 if product_id and isinstance(product_id, int):
58 ret.tables.append('"tender_line"')
59 ret.joins.setdefault('"tender"', [])
60 ret.joins['"tender"'] += [('"tender_line"', 'id', 'tender_id', 'LEFT JOIN')]
61 ret.where_clause.append(''' "tender_line"."product_id" = %s ''')
62 ret.where_clause_params.append(product_id)
63 return ret
64
44 def copy(self, cr, uid, id, default=None, context=None, done_list=[], local=False):65 def copy(self, cr, uid, id, default=None, context=None, done_list=[], local=False):
45 if not default:66 if not default:
46 default = {}67 default = {}
@@ -116,6 +137,19 @@
116 res[tender.id] = diff_number137 res[tender.id] = diff_number
117 return res138 return res
118139
140 def _get_fake(self, cr, uid, ids, name, args, context=None):
141 '''
142 Fake method for 'product_id' field
143 '''
144 res = {}
145 if not ids:
146 return res
147 if isinstance(ids, (int, long)):
148 ids = [ids]
149 for id in ids:
150 res[id] = False
151 return res
152
119 _columns = {153 _columns = {
120 'name': fields.char('Tender Reference', size=64, required=True, select=True, readonly=True, sort_column='id'),154 'name': fields.char('Tender Reference', size=64, required=True, select=True, readonly=True, sort_column='id'),
121 'sale_order_id': fields.many2one('sale.order', string="Sale Order", readonly=True),155 'sale_order_id': fields.many2one('sale.order', string="Sale Order", readonly=True),
@@ -136,7 +170,7 @@
136 'notes': fields.text('Notes'),170 'notes': fields.text('Notes'),
137 'internal_state': fields.selection([('draft', 'Draft'), ('updated', 'Rfq Updated'), ], string="Internal State", readonly=True),171 'internal_state': fields.selection([('draft', 'Draft'), ('updated', 'Rfq Updated'), ], string="Internal State", readonly=True),
138 'rfq_name_list': fields.function(_vals_get, method=True, string='RfQs Ref', type='char', readonly=True, store=False, multi='get_vals',),172 'rfq_name_list': fields.function(_vals_get, method=True, string='RfQs Ref', type='char', readonly=True, store=False, multi='get_vals',),
139 'product_id': fields.related('tender_line_ids', 'product_id', type='many2one', relation='product.product', string='Product'),173 'product_id': fields.function(_get_fake, method=True, type='many2one', relation='product.product', string='Product', help='Product to find in the lines', store=False, readonly=True),
140 'delivery_address': fields.many2one('res.partner.address', string='Delivery address', required=True),174 'delivery_address': fields.many2one('res.partner.address', string='Delivery address', required=True),
141 'tender_from_fo': fields.function(_is_tender_from_fo, method=True, type='boolean', string='Is tender from FO ?',),175 'tender_from_fo': fields.function(_is_tender_from_fo, method=True, type='boolean', string='Is tender from FO ?',),
142 'diff_nb_rfq_supplier': fields.function(_diff_nb_rfq_supplier, method=True, type="boolean", string="Compare the number of rfqs and the number of suppliers", store=False),176 'diff_nb_rfq_supplier': fields.function(_diff_nb_rfq_supplier, method=True, type="boolean", string="Compare the number of rfqs and the number of suppliers", store=False),
143177
=== modified file 'bin/addons/tender_flow/tender_flow_view.xml'
--- bin/addons/tender_flow/tender_flow_view.xml 2020-05-06 12:28:03 +0000
+++ bin/addons/tender_flow/tender_flow_view.xml 2022-07-13 15:38:28 +0000
@@ -136,7 +136,7 @@
136 domain="[('state', '=', 'cancel')]" />136 domain="[('state', '=', 'cancel')]" />
137 <field name="name" />137 <field name="name" />
138 <field name="supplier_ids" string="Supplier" widget="many2one" />138 <field name="supplier_ids" string="Supplier" widget="many2one" />
139 <field name="product_id" string="Product" widget="many2one" />139 <field name="product_id" />
140 <field name="sale_order_id" string="Sale Order" />140 <field name="sale_order_id" string="Sale Order" />
141 <field name="creator" />141 <field name="creator" />
142 <field name="creation_date" />142 <field name="creation_date" />
143143
=== modified file 'bin/import_xml.rng'
--- bin/import_xml.rng 2021-10-12 15:17:17 +0000
+++ bin/import_xml.rng 2022-07-13 15:38:28 +0000
@@ -214,6 +214,7 @@
214 <rng:optional> <rng:attribute name="empty_ids"/> </rng:optional>214 <rng:optional> <rng:attribute name="empty_ids"/> </rng:optional>
215 <rng:optional> <rng:attribute name="auto_refresh"/> </rng:optional>215 <rng:optional> <rng:attribute name="auto_refresh"/> </rng:optional>
216 <rng:optional> <rng:attribute name="search_view_id"/> </rng:optional>216 <rng:optional> <rng:attribute name="search_view_id"/> </rng:optional>
217 <rng:optional> <rng:attribute name="sequence"/> </rng:optional>
217 <rng:empty />218 <rng:empty />
218 </rng:element>219 </rng:element>
219 </rng:define>220 </rng:define>
220221
=== modified file 'bin/tools/convert.py'
--- bin/tools/convert.py 2021-10-12 15:17:17 +0000
+++ bin/tools/convert.py 2022-07-13 15:38:28 +0000
@@ -537,7 +537,7 @@
537 if rec.get('view_ids'):537 if rec.get('view_ids'):
538 for x in rec.get('view_ids').split(','):538 for x in rec.get('view_ids').split(','):
539 linked_views.append(self.id_get(cr,x))539 linked_views.append(self.id_get(cr,x))
540 self.pool.get('ir.model.data').ir_set(cr, self.uid, 'action', keyword, xml_id, [src_model], value, replace=replace, isobject=True, xml_id=xml_id, view_ids=linked_views)540 self.pool.get('ir.model.data').ir_set(cr, self.uid, 'action', keyword, xml_id, [src_model], value, replace=replace, isobject=True, xml_id=xml_id, view_ids=linked_views, sequence=rec.get('sequence', 100))
541 # TODO add remove ir.model.data541 # TODO add remove ir.model.data
542542
543 def _tag_ir_set(self, cr, rec, data_node=None):543 def _tag_ir_set(self, cr, rec, data_node=None):

Subscribers

People subscribed via source and target branches