Merge lp:~jfb-tempo-consulting/unifield-server/US-8336 into lp:unifield-server
- US-8336
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 6083 |
Proposed branch: | lp:~jfb-tempo-consulting/unifield-server/US-8336 |
Merge into: | lp:unifield-server |
Diff against target: |
438 lines (+208/-39) 7 files modified
bin/addons/mission_stock/mission_stock.py (+82/-29) bin/addons/mission_stock/mission_stock_view.xml (+40/-0) bin/addons/msf_profile/data/patches.xml (+3/-0) bin/addons/msf_profile/msf_profile.py (+71/-1) bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv (+2/-2) bin/addons/product_attributes/product_attributes.py (+7/-5) bin/addons/product_attributes/wizard/product_merged.py (+3/-2) |
To merge this branch: | bzr merge lp:~jfb-tempo-consulting/unifield-server/US-8336 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+409202@code.launchpad.net |
Commit message
Description of the change
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/mission_stock/mission_stock.py' | |||
2 | --- bin/addons/mission_stock/mission_stock.py 2021-02-09 17:29:10 +0000 | |||
3 | +++ bin/addons/mission_stock/mission_stock.py 2021-09-27 10:27:25 +0000 | |||
4 | @@ -1019,6 +1019,7 @@ | |||
5 | 1019 | qty = self.pool.get('product.uom')._compute_qty(cr, uid, uom, qty, line.product_id.uom_id.id) | 1019 | qty = self.pool.get('product.uom')._compute_qty(cr, uid, uom, qty, line.product_id.uom_id.id) |
6 | 1020 | 1020 | ||
7 | 1021 | vals['in_pipe_qty'] += qty | 1021 | vals['in_pipe_qty'] += qty |
8 | 1022 | vals['used_in_transaction'] = True | ||
9 | 1022 | 1023 | ||
10 | 1023 | if partner == coordo_id: | 1024 | if partner == coordo_id: |
11 | 1024 | vals['in_pipe_coor_qty'] += qty | 1025 | vals['in_pipe_coor_qty'] += qty |
12 | @@ -1047,6 +1048,53 @@ | |||
13 | 1047 | ''') | 1048 | ''') |
14 | 1048 | res = cr.fetchall() | 1049 | res = cr.fetchall() |
15 | 1049 | all_move_ids = [] | 1050 | all_move_ids = [] |
16 | 1051 | doc_field_error_dom = [ | ||
17 | 1052 | ('stock_move', 'product_id'), | ||
18 | 1053 | ('stock_production_lot', 'product_id'), | ||
19 | 1054 | ('purchase_order_line', 'product_id'), | ||
20 | 1055 | ('sale_order_line', 'product_id'), | ||
21 | 1056 | ('tender_line', 'product_id'), | ||
22 | 1057 | ('physical_inventory_counting', 'product_id'), | ||
23 | 1058 | ('initial_stock_inventory_line', 'product_id'), | ||
24 | 1059 | ('real_average_consumption_line', 'product_id'), | ||
25 | 1060 | ('replenishment_segment_line', 'product_id'), | ||
26 | 1061 | ('product_list_line', 'name'), | ||
27 | 1062 | ('composition_kit', 'composition_product_id'), | ||
28 | 1063 | ('composition_item', 'item_product_id'), | ||
29 | 1064 | ] | ||
30 | 1065 | |||
31 | 1066 | timer_used = time.time() | ||
32 | 1067 | # record the current value in transaction_updated | ||
33 | 1068 | cr.execute("update stock_mission_report_line set transaction_updated=coalesce(used_in_transaction, 'f'), used_in_transaction='f' where mission_report_id=%s", (report_id, )) | ||
34 | 1069 | for table, foreign_field in doc_field_error_dom: | ||
35 | 1070 | # set used_in_transaction='t' | ||
36 | 1071 | cr.execute(''' | ||
37 | 1072 | update | ||
38 | 1073 | stock_mission_report_line l | ||
39 | 1074 | set | ||
40 | 1075 | used_in_transaction='t' | ||
41 | 1076 | from | ||
42 | 1077 | ''' + table + ''' ft | ||
43 | 1078 | where | ||
44 | 1079 | coalesce(l.used_in_transaction,'f')='f' and | ||
45 | 1080 | l.mission_report_id = %s and | ||
46 | 1081 | ft.''' + foreign_field + ''' = l.product_id | ||
47 | 1082 | ''', (report_id, )) # not_a_user_entry | ||
48 | 1083 | |||
49 | 1084 | # trigger sync update | ||
50 | 1085 | cr.execute(''' | ||
51 | 1086 | update ir_model_data d | ||
52 | 1087 | set last_modification=NOW(), touched='[''used_in_transaction'']' | ||
53 | 1088 | from | ||
54 | 1089 | stock_mission_report_line l | ||
55 | 1090 | where | ||
56 | 1091 | l.id = d.res_id and | ||
57 | 1092 | l.transaction_updated!=used_in_transaction and | ||
58 | 1093 | d.model='stock.mission.report.line' and | ||
59 | 1094 | l.mission_report_id = %s | ||
60 | 1095 | ''', (report_id, )) | ||
61 | 1096 | logging.getLogger('MSR').info("""___ computation of used in transaction in %.2f sec.""" % (time.time() - timer_used)) | ||
62 | 1097 | |||
63 | 1050 | for move in res: | 1098 | for move in res: |
64 | 1051 | all_move_ids.append(move[0]) | 1099 | all_move_ids.append(move[0]) |
65 | 1052 | product = product_obj.browse(cr, uid, move[1], | 1100 | product = product_obj.browse(cr, uid, move[1], |
66 | @@ -1056,17 +1104,19 @@ | |||
67 | 1056 | if line_id: | 1104 | if line_id: |
68 | 1057 | line = line_obj.browse(cr, uid, line_id[0]) | 1105 | line = line_obj.browse(cr, uid, line_id[0]) |
69 | 1058 | qty = self.pool.get('product.uom')._compute_qty(cr, uid, move[2], move[3], product.uom_id.id) | 1106 | qty = self.pool.get('product.uom')._compute_qty(cr, uid, move[2], move[3], product.uom_id.id) |
81 | 1059 | vals = {'internal_qty': line.internal_qty or 0.00, | 1107 | vals = { |
82 | 1060 | 'stock_qty': line.stock_qty or 0.00, | 1108 | 'internal_qty': line.internal_qty or 0.00, |
83 | 1061 | 'cross_qty': line.cross_qty or 0.00, | 1109 | 'stock_qty': line.stock_qty or 0.00, |
84 | 1062 | 'secondary_qty': line.secondary_qty or 0.00, | 1110 | 'cross_qty': line.cross_qty or 0.00, |
85 | 1063 | 'cu_qty': line.cu_qty or 0.00, | 1111 | 'secondary_qty': line.secondary_qty or 0.00, |
86 | 1064 | 'quarantine_qty': line.quarantine_qty or 0.00, | 1112 | 'cu_qty': line.cu_qty or 0.00, |
87 | 1065 | 'input_qty': line.input_qty or 0.00, | 1113 | 'quarantine_qty': line.quarantine_qty or 0.00, |
88 | 1066 | 'opdd_qty': line.opdd_qty or 0.00, | 1114 | 'input_qty': line.input_qty or 0.00, |
89 | 1067 | 'updated': True, | 1115 | 'opdd_qty': line.opdd_qty or 0.00, |
90 | 1068 | 'product_state': line.product_id.state and line.product_id.state.code,} | 1116 | 'updated': True, |
91 | 1069 | 1117 | 'product_state': line.product_id.state and line.product_id.state.code, | |
92 | 1118 | 'used_in_transaction': True | ||
93 | 1119 | } | ||
94 | 1070 | if move[4] in internal_loc: | 1120 | if move[4] in internal_loc: |
95 | 1071 | vals['internal_qty'] -= qty | 1121 | vals['internal_qty'] -= qty |
96 | 1072 | if move[4] in stock_loc: | 1122 | if move[4] in stock_loc: |
97 | @@ -1500,8 +1550,8 @@ | |||
98 | 1500 | 'product_id': fields.many2one('product.product', string='Name', required=True, ondelete="cascade", select=1), | 1550 | 'product_id': fields.many2one('product.product', string='Name', required=True, ondelete="cascade", select=1), |
99 | 1501 | 'default_code': fields.related('product_id', 'default_code', string='Reference', type='char', size=64, store=True, write_relate=False), | 1551 | 'default_code': fields.related('product_id', 'default_code', string='Reference', type='char', size=64, store=True, write_relate=False), |
100 | 1502 | 'xmlid_code': fields.related('product_id', 'xmlid_code', string='MSFID', type='char', size=18, store=True, write_relate=False, _fnct_migrate=xmlid_code_migration), | 1552 | 'xmlid_code': fields.related('product_id', 'xmlid_code', string='MSFID', type='char', size=18, store=True, write_relate=False, _fnct_migrate=xmlid_code_migration), |
103 | 1503 | 'old_code': fields.related('product_id', 'old_code', string='Old Code', type='char'), | 1553 | 'old_code': fields.related('product_id', 'old_code', string='Old Code', type='char', write_relate=False), |
104 | 1504 | 'name': fields.related('product_id', 'name', string='Name', type='char'), | 1554 | 'name': fields.related('product_id', 'name', string='Name', type='char', write_relate=False), |
105 | 1505 | 'categ_id': fields.related('product_id', 'categ_id', string='Category', type='many2one', relation='product.category', | 1555 | 'categ_id': fields.related('product_id', 'categ_id', string='Category', type='many2one', relation='product.category', |
106 | 1506 | store={'product.template': (_get_template, ['type'], 10), | 1556 | store={'product.template': (_get_template, ['type'], 10), |
107 | 1507 | 'stock.mission.report.line': (lambda self, cr, uid, ids, c={}: ids, ['product_id'], 10)}, | 1557 | 'stock.mission.report.line': (lambda self, cr, uid, ids, c={}: ids, ['product_id'], 10)}, |
108 | @@ -1526,17 +1576,17 @@ | |||
109 | 1526 | ), | 1576 | ), |
110 | 1527 | 'product_state': fields.char(size=128, string='Unifield state'), | 1577 | 'product_state': fields.char(size=128, string='Unifield state'), |
111 | 1528 | # mandatory nomenclature levels | 1578 | # mandatory nomenclature levels |
116 | 1529 | 'nomen_manda_0': fields.related('product_id', 'nomen_manda_0', type='many2one', relation='product.nomenclature', string='Main Type'), | 1579 | 'nomen_manda_0': fields.related('product_id', 'nomen_manda_0', type='many2one', relation='product.nomenclature', string='Main Type', write_relate=False), |
117 | 1530 | 'nomen_manda_1': fields.related('product_id', 'nomen_manda_1', type='many2one', relation='product.nomenclature', string='Group'), | 1580 | 'nomen_manda_1': fields.related('product_id', 'nomen_manda_1', type='many2one', relation='product.nomenclature', string='Group', write_relate=False), |
118 | 1531 | 'nomen_manda_2': fields.related('product_id', 'nomen_manda_2', type='many2one', relation='product.nomenclature', string='Family'), | 1581 | 'nomen_manda_2': fields.related('product_id', 'nomen_manda_2', type='many2one', relation='product.nomenclature', string='Family', write_relate=False), |
119 | 1532 | 'nomen_manda_3': fields.related('product_id', 'nomen_manda_3', type='many2one', relation='product.nomenclature', string='Root'), | 1582 | 'nomen_manda_3': fields.related('product_id', 'nomen_manda_3', type='many2one', relation='product.nomenclature', string='Root', write_relate=False), |
120 | 1533 | # optional nomenclature levels | 1583 | # optional nomenclature levels |
127 | 1534 | 'nomen_sub_0': fields.related('product_id', 'nomen_sub_0', type='many2one', relation='product.nomenclature', string='Sub Class 1'), | 1584 | 'nomen_sub_0': fields.related('product_id', 'nomen_sub_0', type='many2one', relation='product.nomenclature', string='Sub Class 1', write_relate=False), |
128 | 1535 | 'nomen_sub_1': fields.related('product_id', 'nomen_sub_1', type='many2one', relation='product.nomenclature', string='Sub Class 2'), | 1585 | 'nomen_sub_1': fields.related('product_id', 'nomen_sub_1', type='many2one', relation='product.nomenclature', string='Sub Class 2', write_relate=False), |
129 | 1536 | 'nomen_sub_2': fields.related('product_id', 'nomen_sub_2', type='many2one', relation='product.nomenclature', string='Sub Class 3'), | 1586 | 'nomen_sub_2': fields.related('product_id', 'nomen_sub_2', type='many2one', relation='product.nomenclature', string='Sub Class 3', write_relate=False), |
130 | 1537 | 'nomen_sub_3': fields.related('product_id', 'nomen_sub_3', type='many2one', relation='product.nomenclature', string='Sub Class 4'), | 1587 | 'nomen_sub_3': fields.related('product_id', 'nomen_sub_3', type='many2one', relation='product.nomenclature', string='Sub Class 4', write_relate=False), |
131 | 1538 | 'nomen_sub_4': fields.related('product_id', 'nomen_sub_4', type='many2one', relation='product.nomenclature', string='Sub Class 5'), | 1588 | 'nomen_sub_4': fields.related('product_id', 'nomen_sub_4', type='many2one', relation='product.nomenclature', string='Sub Class 5', write_relate=False), |
132 | 1539 | 'nomen_sub_5': fields.related('product_id', 'nomen_sub_5', type='many2one', relation='product.nomenclature', string='Sub Class 6'), | 1589 | 'nomen_sub_5': fields.related('product_id', 'nomen_sub_5', type='many2one', relation='product.nomenclature', string='Sub Class 6', write_relate=False), |
133 | 1540 | 'nomen_manda_0_s': fields.function(_get_nomen_s, method=True, type='many2one', relation='product.nomenclature', string='Main Type', fnct_search=_search_nomen_s, multi="nom_s"), | 1590 | 'nomen_manda_0_s': fields.function(_get_nomen_s, method=True, type='many2one', relation='product.nomenclature', string='Main Type', fnct_search=_search_nomen_s, multi="nom_s"), |
134 | 1541 | 'nomen_manda_1_s': fields.function(_get_nomen_s, method=True, type='many2one', relation='product.nomenclature', string='Group', fnct_search=_search_nomen_s, multi="nom_s"), | 1591 | 'nomen_manda_1_s': fields.function(_get_nomen_s, method=True, type='many2one', relation='product.nomenclature', string='Group', fnct_search=_search_nomen_s, multi="nom_s"), |
135 | 1542 | 'nomen_manda_2_s': fields.function(_get_nomen_s, method=True, type='many2one', relation='product.nomenclature', string='Family', fnct_search=_search_nomen_s, multi="nom_s"), | 1592 | 'nomen_manda_2_s': fields.function(_get_nomen_s, method=True, type='many2one', relation='product.nomenclature', string='Family', fnct_search=_search_nomen_s, multi="nom_s"), |
136 | @@ -1552,8 +1602,8 @@ | |||
137 | 1552 | 'product_amc': fields.float('AMC'), | 1602 | 'product_amc': fields.float('AMC'), |
138 | 1553 | 'product_consumption': fields.float('FMC'), | 1603 | 'product_consumption': fields.float('FMC'), |
139 | 1554 | 1604 | ||
142 | 1555 | 'currency_id': fields.related('product_id', 'currency_id', type='many2one', relation='res.currency', string='Func. cur.'), | 1605 | 'currency_id': fields.related('product_id', 'currency_id', type='many2one', relation='res.currency', string='Func. cur.', write_relate=False), |
143 | 1556 | 'cost_price': fields.related('product_id', 'standard_price', type='float', string='Cost price'), | 1606 | 'cost_price': fields.related('product_id', 'standard_price', type='float', string='Cost price', write_relate=False), |
144 | 1557 | 'uom_id': fields.related('product_id', 'uom_id', type='many2one', relation='product.uom', string='UoM', | 1607 | 'uom_id': fields.related('product_id', 'uom_id', type='many2one', relation='product.uom', string='UoM', |
145 | 1558 | store={ | 1608 | store={ |
146 | 1559 | 'product.template': (_get_template, ['type'], 10), | 1609 | 'product.template': (_get_template, ['type'], 10), |
147 | @@ -1582,7 +1632,7 @@ | |||
148 | 1582 | 'in_pipe_coor_qty': fields.float(digits=(16,2), string='In Pipe from Coord.', related_uom='uom_id'), | 1632 | 'in_pipe_coor_qty': fields.float(digits=(16,2), string='In Pipe from Coord.', related_uom='uom_id'), |
149 | 1583 | 'in_pipe_coor_val': fields.float(digits=(16,2), string='In Pipe from Coord.', related_uom='uom_id'), | 1633 | 'in_pipe_coor_val': fields.float(digits=(16,2), string='In Pipe from Coord.', related_uom='uom_id'), |
150 | 1584 | 'updated': fields.boolean(string='Updated'), | 1634 | 'updated': fields.boolean(string='Updated'), |
152 | 1585 | 'full_view': fields.related('mission_report_id', 'full_view', string='Full view', type='boolean', store=True), | 1635 | 'full_view': fields.related('mission_report_id', 'full_view', string='Full view', type='boolean', store=True, write_relate=False), |
153 | 1586 | 'instance_id': fields.many2one( | 1636 | 'instance_id': fields.many2one( |
154 | 1587 | 'msf.instance', | 1637 | 'msf.instance', |
155 | 1588 | string='HQ Instance', | 1638 | string='HQ Instance', |
156 | @@ -1591,6 +1641,8 @@ | |||
157 | 1591 | 'quarantine_qty': fields.float(digits=(16, 2), string='Quarantine Qty.', related_uom='uom_id'), | 1641 | 'quarantine_qty': fields.float(digits=(16, 2), string='Quarantine Qty.', related_uom='uom_id'), |
158 | 1592 | 'input_qty': fields.float(digits=(16, 2), string='Input Qty.', related_uom='uom_id'), | 1642 | 'input_qty': fields.float(digits=(16, 2), string='Input Qty.', related_uom='uom_id'), |
159 | 1593 | 'opdd_qty': fields.float(digits=(16, 2), string='Output/Packing/Dispatch/Distribution Qty.', related_uom='uom_id'), | 1643 | 'opdd_qty': fields.float(digits=(16, 2), string='Output/Packing/Dispatch/Distribution Qty.', related_uom='uom_id'), |
160 | 1644 | 'used_in_transaction': fields.boolean('Used in a transaction'), | ||
161 | 1645 | 'transaction_updated': fields.boolean('Used changed', help='temporary value used to touch ir.model.data'), | ||
162 | 1594 | } | 1646 | } |
163 | 1595 | 1647 | ||
164 | 1596 | @tools.cache(skiparg=2) | 1648 | @tools.cache(skiparg=2) |
165 | @@ -1642,7 +1694,8 @@ | |||
166 | 1642 | sum(l.internal_qty)*t.standard_price AS internal_val, | 1694 | sum(l.internal_qty)*t.standard_price AS internal_val, |
167 | 1643 | sum(l.quarantine_qty) AS quarantine_qty, | 1695 | sum(l.quarantine_qty) AS quarantine_qty, |
168 | 1644 | sum(l.input_qty) AS input_qty, | 1696 | sum(l.input_qty) AS input_qty, |
170 | 1645 | sum(l.opdd_qty) AS opdd_qty | 1697 | sum(l.opdd_qty) AS opdd_qty, |
171 | 1698 | bool_or(used_in_transaction) AS used_in_transaction | ||
172 | 1646 | FROM stock_mission_report_line l | 1699 | FROM stock_mission_report_line l |
173 | 1647 | LEFT JOIN | 1700 | LEFT JOIN |
174 | 1648 | stock_mission_report m | 1701 | stock_mission_report m |
175 | @@ -1683,10 +1736,10 @@ | |||
176 | 1683 | internal_qty=%s, stock_qty=%s, | 1736 | internal_qty=%s, stock_qty=%s, |
177 | 1684 | cross_qty=%s, secondary_qty=%s, | 1737 | cross_qty=%s, secondary_qty=%s, |
178 | 1685 | cu_qty=%s, in_pipe_qty=%s, in_pipe_coor_qty=%s, | 1738 | cu_qty=%s, in_pipe_qty=%s, in_pipe_coor_qty=%s, |
180 | 1686 | wh_qty=%s, quarantine_qty=%s, input_qty=%s, opdd_qty=%s | 1739 | wh_qty=%s, quarantine_qty=%s, input_qty=%s, opdd_qty=%s, used_in_transaction=%s |
181 | 1687 | WHERE id=%s""" % (line[1] or 0.00, line[2] or 0.00, line[3] or 0.00, line[4] or 0.00, | 1740 | WHERE id=%s""" % (line[1] or 0.00, line[2] or 0.00, line[3] or 0.00, line[4] or 0.00, |
182 | 1688 | line[5] or 0.00, line[6] or 0.00, line[7] or 0.00, | 1741 | line[5] or 0.00, line[6] or 0.00, line[7] or 0.00, |
184 | 1689 | (line[2] or 0.00) + (line[3] or 0.00), line[9], line[10], line[11], line_id)) # not_a_user_entry | 1742 | (line[2] or 0.00) + (line[3] or 0.00), line[9], line[10], line[11], line[12] or False, line_id)) # not_a_user_entry |
185 | 1690 | return True | 1743 | return True |
186 | 1691 | 1744 | ||
187 | 1692 | 1745 | ||
188 | 1693 | 1746 | ||
189 | === modified file 'bin/addons/mission_stock/mission_stock_view.xml' | |||
190 | --- bin/addons/mission_stock/mission_stock_view.xml 2020-10-20 15:57:14 +0000 | |||
191 | +++ bin/addons/mission_stock/mission_stock_view.xml 2021-09-27 10:27:25 +0000 | |||
192 | @@ -80,6 +80,7 @@ | |||
193 | 80 | <field name="default_code"/> | 80 | <field name="default_code"/> |
194 | 81 | <field name="name"/> | 81 | <field name="name"/> |
195 | 82 | <field name="categ_id" widget="selection" operator="child_of"/> | 82 | <field name="categ_id" widget="selection" operator="child_of"/> |
196 | 83 | <field name="used_in_transaction" /> | ||
197 | 83 | <newline/> | 84 | <newline/> |
198 | 84 | <filter string="Single Item" icon="terp-accessories-archiver" domain="[('subtype','=','single')]"/> | 85 | <filter string="Single Item" icon="terp-accessories-archiver" domain="[('subtype','=','single')]"/> |
199 | 85 | <filter string="Kit/Module" icon="terp-accessories-archiver" domain="[('subtype','=','kit')]"/> | 86 | <filter string="Kit/Module" icon="terp-accessories-archiver" domain="[('subtype','=','kit')]"/> |
200 | @@ -152,12 +153,51 @@ | |||
201 | 152 | <!-- <field name="cu_val" invisible="not context.get('with_valuation')" /> --> | 153 | <!-- <field name="cu_val" invisible="not context.get('with_valuation')" /> --> |
202 | 153 | <field name="product_amc" invisible="context.get('hide_amc_fmc')"/> | 154 | <field name="product_amc" invisible="context.get('hide_amc_fmc')"/> |
203 | 154 | <field name="product_consumption" invisible="context.get('hide_amc_fmc')" /> | 155 | <field name="product_consumption" invisible="context.get('hide_amc_fmc')" /> |
204 | 156 | <field name="used_in_transaction" /> | ||
205 | 155 | <field name="in_pipe_qty" /> | 157 | <field name="in_pipe_qty" /> |
206 | 156 | <field name="categ_id" invisible="1" /> | 158 | <field name="categ_id" invisible="1" /> |
207 | 157 | <field name="type" invisible="1" /> | 159 | <field name="type" invisible="1" /> |
208 | 158 | </tree> | 160 | </tree> |
209 | 159 | </field> | 161 | </field> |
210 | 160 | </record> | 162 | </record> |
211 | 163 | |||
212 | 164 | <record id="mission_stock_line_form_view" model="ir.ui.view"> | ||
213 | 165 | <field name="name">mission.stock.product.form.view</field> | ||
214 | 166 | <field name="model">stock.mission.report.line</field> | ||
215 | 167 | <field name="type">form</field> | ||
216 | 168 | <field name="arch" type="xml"> | ||
217 | 169 | <form string="Mission Stock Report" noteditable="1" hide_new_button="1" hide_save_button="1" hide_duplicate_button="1" hide_delete_button="1"> | ||
218 | 170 | <field name="product_id" /> | ||
219 | 171 | <field name="default_code" /> | ||
220 | 172 | <field name="name" /> | ||
221 | 173 | <field name="product_active" /> | ||
222 | 174 | <field name="uom_id" /> | ||
223 | 175 | <field name="cost_price" invisible="not context.get('with_valuation')" /> | ||
224 | 176 | <field name="currency_id" invisible="not context.get('with_valuation')" /> | ||
225 | 177 | <field name="internal_qty" /> | ||
226 | 178 | <field name="internal_val" invisible="not context.get('with_valuation')" /> | ||
227 | 179 | <!-- field name="in_pipe_coor_qty" /> | ||
228 | 180 | <field name="in_pipe_coor_val" invisible="not context.get('with_valuation')" / --> | ||
229 | 181 | <field name="stock_qty" /> | ||
230 | 182 | <field name="cross_qty" /> | ||
231 | 183 | <!-- <field name="cross_val" invisible="not context.get('with_valuation')" /> --> | ||
232 | 184 | <field name="secondary_qty" /> | ||
233 | 185 | <!-- <field name="secondary_val" invisible="not context.get('with_valuation')" /> --> | ||
234 | 186 | <field name="cu_qty" /> | ||
235 | 187 | <field name="quarantine_qty" /> | ||
236 | 188 | <field name="input_qty" /> | ||
237 | 189 | <field name="opdd_qty" /> | ||
238 | 190 | <!-- <field name="cu_val" invisible="not context.get('with_valuation')" /> --> | ||
239 | 191 | <field name="product_amc" invisible="context.get('hide_amc_fmc')"/> | ||
240 | 192 | <field name="product_consumption" invisible="context.get('hide_amc_fmc')" /> | ||
241 | 193 | <field name="used_in_transaction" /> | ||
242 | 194 | <field name="in_pipe_qty" /> | ||
243 | 195 | <field name="categ_id" invisible="1" /> | ||
244 | 196 | <field name="type" invisible="1" /> | ||
245 | 197 | </form> | ||
246 | 198 | </field> | ||
247 | 199 | </record> | ||
248 | 200 | |||
249 | 161 | 201 | ||
250 | 162 | <record id="consolidated_mission_stock_wizard_view" model="ir.ui.view"> | 202 | <record id="consolidated_mission_stock_wizard_view" model="ir.ui.view"> |
251 | 163 | <field name="name">consolidated.mission.stock.wizard.view</field> | 203 | <field name="name">consolidated.mission.stock.wizard.view</field> |
252 | 164 | 204 | ||
253 | === modified file 'bin/addons/msf_profile/data/patches.xml' | |||
254 | --- bin/addons/msf_profile/data/patches.xml 2021-08-18 16:06:31 +0000 | |||
255 | +++ bin/addons/msf_profile/data/patches.xml 2021-09-27 10:27:25 +0000 | |||
256 | @@ -701,5 +701,8 @@ | |||
257 | 701 | <record id="us_9003_partner_im_is_currencies" model="patch.scripts"> | 701 | <record id="us_9003_partner_im_is_currencies" model="patch.scripts"> |
258 | 702 | <field name="method">us_9003_partner_im_is_currencies</field> | 702 | <field name="method">us_9003_partner_im_is_currencies</field> |
259 | 703 | </record> | 703 | </record> |
260 | 704 | <record id="us_8336_update_msr_used" model="patch.scripts"> | ||
261 | 705 | <field name="method">us_8336_update_msr_used</field> | ||
262 | 706 | </record> | ||
263 | 704 | </data> | 707 | </data> |
264 | 705 | </openerp> | 708 | </openerp> |
265 | 706 | 709 | ||
266 | === modified file 'bin/addons/msf_profile/msf_profile.py' | |||
267 | --- bin/addons/msf_profile/msf_profile.py 2021-08-19 10:03:30 +0000 | |||
268 | +++ bin/addons/msf_profile/msf_profile.py 2021-09-27 10:27:25 +0000 | |||
269 | @@ -37,6 +37,7 @@ | |||
270 | 37 | from msf_field_access_rights.osv_override import _get_instance_level | 37 | from msf_field_access_rights.osv_override import _get_instance_level |
271 | 38 | import cStringIO | 38 | import cStringIO |
272 | 39 | import csv | 39 | import csv |
273 | 40 | import zlib | ||
274 | 40 | 41 | ||
275 | 41 | 42 | ||
276 | 42 | class patch_scripts(osv.osv): | 43 | class patch_scripts(osv.osv): |
277 | @@ -53,6 +54,65 @@ | |||
278 | 53 | 'model': lambda *a: 'patch.scripts', | 54 | 'model': lambda *a: 'patch.scripts', |
279 | 54 | } | 55 | } |
280 | 55 | 56 | ||
281 | 57 | def us_8336_update_msr_used(self, cr, uid, *a, **b): | ||
282 | 58 | if not self.pool.get('sync.client.entity'): | ||
283 | 59 | # exclude new instances | ||
284 | 60 | return True | ||
285 | 61 | |||
286 | 62 | if _get_instance_level(self, cr, uid) == 'hq': | ||
287 | 63 | # exclude hq | ||
288 | 64 | return True | ||
289 | 65 | |||
290 | 66 | doc_field_error_dom = [ | ||
291 | 67 | ('stock_move', 'product_id'), | ||
292 | 68 | ('stock_production_lot', 'product_id'), | ||
293 | 69 | ('purchase_order_line', 'product_id'), | ||
294 | 70 | ('sale_order_line', 'product_id'), | ||
295 | 71 | ('tender_line', 'product_id'), | ||
296 | 72 | ('physical_inventory_counting', 'product_id'), | ||
297 | 73 | ('initial_stock_inventory_line', 'product_id'), | ||
298 | 74 | ('real_average_consumption_line', 'product_id'), | ||
299 | 75 | ('replenishment_segment_line', 'product_id'), | ||
300 | 76 | ('product_list_line', 'name'), | ||
301 | 77 | ('composition_kit', 'composition_product_id'), | ||
302 | 78 | ('composition_item', 'item_product_id'), | ||
303 | 79 | ] | ||
304 | 80 | report_ids = self.pool.get('stock.mission.report').search(cr, uid, [('local_report', '=', True), ('full_view', '=', False)]) | ||
305 | 81 | if not report_ids: | ||
306 | 82 | return True | ||
307 | 83 | report_id = report_ids[0] | ||
308 | 84 | for table, foreign_field in doc_field_error_dom: | ||
309 | 85 | # set used_in_transaction='t' | ||
310 | 86 | cr.execute(''' | ||
311 | 87 | update | ||
312 | 88 | stock_mission_report_line l | ||
313 | 89 | set | ||
314 | 90 | used_in_transaction='t' | ||
315 | 91 | from | ||
316 | 92 | ''' + table + ''' ft | ||
317 | 93 | where | ||
318 | 94 | coalesce(l.used_in_transaction,'f')='f' and | ||
319 | 95 | l.mission_report_id = %s and | ||
320 | 96 | ft.''' + foreign_field + ''' = l.product_id | ||
321 | 97 | ''', (report_id, )) # not_a_user_entry | ||
322 | 98 | |||
323 | 99 | cr.execute(''' | ||
324 | 100 | select d.name | ||
325 | 101 | from ir_model_data d, stock_mission_report_line l | ||
326 | 102 | where | ||
327 | 103 | l.id = d.res_id and | ||
328 | 104 | used_in_transaction='t' and | ||
329 | 105 | d.model='stock.mission.report.line' and | ||
330 | 106 | l.mission_report_id = %s | ||
331 | 107 | ''', (report_id,)) | ||
332 | 108 | if cr.rowcount: | ||
333 | 109 | zipstr = base64.b64encode(zlib.compress(','.join([x[0] for x in cr.fetchall()]))) | ||
334 | 110 | self.pool.get('sync.trigger.something.up').create(cr, uid, {'name': 'msr_used', 'args': zipstr}) | ||
335 | 111 | return True | ||
336 | 112 | |||
337 | 113 | |||
338 | 114 | |||
339 | 115 | |||
340 | 56 | # UF22.0 | 116 | # UF22.0 |
341 | 57 | def us_9003_partner_im_is_currencies(self, cr, uid, *a, **b): | 117 | def us_9003_partner_im_is_currencies(self, cr, uid, *a, **b): |
342 | 58 | self.us_5559_set_pricelist(cr, uid, *a, **b) | 118 | self.us_5559_set_pricelist(cr, uid, *a, **b) |
343 | @@ -4962,7 +5022,17 @@ | |||
344 | 4962 | if remote_id: | 5022 | if remote_id: |
345 | 4963 | cr.execute("update stock_mission_report_line set cu_qty=0, cu_val=0 where mission_report_id in (select id from stock_mission_report where instance_id = %s and full_view='f')", (remote_id[0],)) | 5023 | cr.execute("update stock_mission_report_line set cu_qty=0, cu_val=0 where mission_report_id in (select id from stock_mission_report where instance_id = %s and full_view='f')", (remote_id[0],)) |
346 | 4964 | _logger.warn('Reset %d mission stock CU Stock for instance_id %s' % (cr.rowcount, remote_id[0])) | 5024 | _logger.warn('Reset %d mission stock CU Stock for instance_id %s' % (cr.rowcount, remote_id[0])) |
348 | 4965 | 5025 | elif vals.get('name') == 'msr_used': | |
349 | 5026 | cr.execute(''' | ||
350 | 5027 | update stock_mission_report_line l | ||
351 | 5028 | set used_in_transaction='t' | ||
352 | 5029 | from | ||
353 | 5030 | ir_model_data d | ||
354 | 5031 | where | ||
355 | 5032 | d.model='stock.mission.report.line' and | ||
356 | 5033 | d.res_id = l.id and | ||
357 | 5034 | d.name in %s | ||
358 | 5035 | ''', (tuple((zlib.decompress(base64.b64decode(vals.get('args'))).split(','))),)) | ||
359 | 4966 | return super(sync_tigger_something_up, self).create(cr, uid, vals, context) | 5036 | return super(sync_tigger_something_up, self).create(cr, uid, vals, context) |
360 | 4967 | 5037 | ||
361 | 4968 | sync_tigger_something_up() | 5038 | sync_tigger_something_up() |
362 | 4969 | 5039 | ||
363 | === modified file 'bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv' | |||
364 | --- bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2021-06-07 13:41:02 +0000 | |||
365 | +++ bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2021-09-27 10:27:25 +0000 | |||
366 | @@ -100,8 +100,8 @@ | |||
367 | 100 | msf_sync_data_server.budget_line,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('budget_id','in',('msf.budget','id',[('type','=','normal'), ('state', '!=', 'draft')]))]","['account_id/id', 'budget_id/id', 'month1', 'month2', 'month3', 'month4', 'month5', 'month6', 'month7', 'month8', 'month9', 'month10', 'month11', 'month12', 'destination_id/id', 'line_type']",OC,msf.budget.line,,Budget line,Valid,,431 | 100 | msf_sync_data_server.budget_line,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('budget_id','in',('msf.budget','id',[('type','=','normal'), ('state', '!=', 'draft')]))]","['account_id/id', 'budget_id/id', 'month1', 'month2', 'month3', 'month4', 'month5', 'month6', 'month7', 'month8', 'month9', 'month10', 'month11', 'month12', 'destination_id/id', 'line_type']",OC,msf.budget.line,,Budget line,Valid,,431 |
368 | 101 | msf_sync_data_server.budget_status,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('type','=','normal'), ('state', '!=', 'draft')]",['state'],OC,msf.budget,,Budget status,Valid,,432 | 101 | msf_sync_data_server.budget_status,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('type','=','normal'), ('state', '!=', 'draft')]",['state'],OC,msf.budget,,Budget status,Valid,,432 |
369 | 102 | msf_sync_data_server.mission_stock_report,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('full_view', '=', False), ('local_report', '=', True)]","['full_view', 'instance_id/id', 'last_update', 'name']",OC,stock.mission.report,,Mission Stock Report,Valid,,440 | 102 | msf_sync_data_server.mission_stock_report,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('full_view', '=', False), ('local_report', '=', True)]","['full_view', 'instance_id/id', 'last_update', 'name']",OC,stock.mission.report,,Mission Stock Report,Valid,,440 |
372 | 103 | msf_sync_data_server.mission_stock_report_line,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('mission_report_id.full_view', '=', False), ('mission_report_id.local_report', '=', True), ('international_status','in',['Local', 'Temporary'])]","['cross_qty', 'cross_val', 'cu_qty', 'cu_val', 'in_pipe_coor_qty', 'in_pipe_coor_val', 'in_pipe_qty', 'in_pipe_val', 'internal_qty', 'internal_val', 'mission_report_id/id', 'product_id/id', 'secondary_qty', 'secondary_val', 'stock_qty', 'stock_val', 'xmlid_code', 'product_state', 'product_active', 'state_ud', 'international_status_code', 'product_amc', 'product_consumption', 'quarantine_qty', 'input_qty', 'opdd_qty']",MISSION,stock.mission.report.line,,Mission Stock Report Line,Valid,,441 | 103 | msf_sync_data_server.mission_stock_report_line,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('mission_report_id.full_view', '=', False), ('mission_report_id.local_report', '=', True), ('international_status','in',['Local', 'Temporary'])]","['cross_qty', 'cross_val', 'cu_qty', 'cu_val', 'in_pipe_coor_qty', 'in_pipe_coor_val', 'in_pipe_qty', 'in_pipe_val', 'internal_qty', 'internal_val', 'mission_report_id/id', 'product_id/id', 'secondary_qty', 'secondary_val', 'stock_qty', 'stock_val', 'xmlid_code', 'product_state', 'product_active', 'state_ud', 'international_status_code', 'product_amc', 'product_consumption', 'quarantine_qty', 'input_qty', 'opdd_qty', 'used_in_transaction']",MISSION,stock.mission.report.line,,Mission Stock Report Line,Valid,,441 |
373 | 104 | msf_sync_data_server.mission_stock_report_line_OC,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('mission_report_id.full_view', '=', False), ('mission_report_id.local_report', '=', True), ('international_status','in',['ITC', 'UniData', 'ESC', 'HQ'])]","['cross_qty', 'cross_val', 'cu_qty', 'cu_val', 'in_pipe_coor_qty', 'in_pipe_coor_val', 'in_pipe_qty', 'in_pipe_val', 'internal_qty', 'internal_val', 'mission_report_id/id', 'product_id/id', 'secondary_qty', 'secondary_val', 'stock_qty', 'stock_val', 'xmlid_code', 'product_state', 'product_active', 'state_ud', 'international_status_code', 'product_amc', 'product_consumption', 'quarantine_qty', 'input_qty', 'opdd_qty']",OC,stock.mission.report.line,,Mission Stock Report Line OC,Valid,,442 | 104 | msf_sync_data_server.mission_stock_report_line_OC,TRUE,TRUE,FALSE,FALSE,bidirectional,Up,"[('mission_report_id.full_view', '=', False), ('mission_report_id.local_report', '=', True), ('international_status','in',['ITC', 'UniData', 'ESC', 'HQ'])]","['cross_qty', 'cross_val', 'cu_qty', 'cu_val', 'in_pipe_coor_qty', 'in_pipe_coor_val', 'in_pipe_qty', 'in_pipe_val', 'internal_qty', 'internal_val', 'mission_report_id/id', 'product_id/id', 'secondary_qty', 'secondary_val', 'stock_qty', 'stock_val', 'xmlid_code', 'product_state', 'product_active', 'state_ud', 'international_status_code', 'product_amc', 'product_consumption', 'quarantine_qty', 'input_qty', 'opdd_qty', 'used_in_transaction']",OC,stock.mission.report.line,,Mission Stock Report Line OC,Valid,,442 |
374 | 105 | msf_sync_data_server.financing_contract_formats_fc,TRUE,TRUE,FALSE,TRUE,bidirectional,Bidirectional-Private,[],"['cost_center_ids/id', 'eligibility_from_date', 'eligibility_to_date', 'format_name', 'overhead_percentage', 'overhead_type', 'reporting_type', 'hidden_instance_id/id']",HQ + MISSION,financing.contract.format,hidden_instance_id,Financing Contract Formats FC,Valid,,450 | 105 | msf_sync_data_server.financing_contract_formats_fc,TRUE,TRUE,FALSE,TRUE,bidirectional,Bidirectional-Private,[],"['cost_center_ids/id', 'eligibility_from_date', 'eligibility_to_date', 'format_name', 'overhead_percentage', 'overhead_type', 'reporting_type', 'hidden_instance_id/id']",HQ + MISSION,financing.contract.format,hidden_instance_id,Financing Contract Formats FC,Valid,,450 |
375 | 106 | msf_sync_data_server.financing_contract_formats,TRUE,TRUE,TRUE,TRUE,bidirectional,Bidirectional,"[('hidden_instance_id','=',False)]","['hidden_instance_id/id','cost_center_ids/id', 'eligibility_from_date', 'eligibility_to_date', 'format_name', 'overhead_percentage', 'overhead_type', 'reporting_type']",HQ + MISSION,financing.contract.format,,Financing Contract Formats,Valid,,451 | 106 | msf_sync_data_server.financing_contract_formats,TRUE,TRUE,TRUE,TRUE,bidirectional,Bidirectional,"[('hidden_instance_id','=',False)]","['hidden_instance_id/id','cost_center_ids/id', 'eligibility_from_date', 'eligibility_to_date', 'format_name', 'overhead_percentage', 'overhead_type', 'reporting_type']",HQ + MISSION,financing.contract.format,,Financing Contract Formats,Valid,,451 |
376 | 107 | msf_sync_data_server.financing_contract_format_lines,TRUE,TRUE,TRUE,TRUE,bidirectional,Bidirectional,"[('instance_id', '=', False)]","['account_destination_ids/id', 'instance_id/id','allocated_budget_value', 'allocated_real_value', 'code', 'format_id/id', 'line_type', 'name', 'overhead_percentage', 'overhead_type', 'project_budget_value', 'project_real_value', 'is_quadruplet', 'quadruplet_sync_list', 'reporting_select_accounts_only', 'reporting_account_ids/id']",HQ + MISSION,financing.contract.format.line,,Financing Contract Format Lines,Valid,,452 | 107 | msf_sync_data_server.financing_contract_format_lines,TRUE,TRUE,TRUE,TRUE,bidirectional,Bidirectional,"[('instance_id', '=', False)]","['account_destination_ids/id', 'instance_id/id','allocated_budget_value', 'allocated_real_value', 'code', 'format_id/id', 'line_type', 'name', 'overhead_percentage', 'overhead_type', 'project_budget_value', 'project_real_value', 'is_quadruplet', 'quadruplet_sync_list', 'reporting_select_accounts_only', 'reporting_account_ids/id']",HQ + MISSION,financing.contract.format.line,,Financing Contract Format Lines,Valid,,452 |
377 | 108 | 108 | ||
378 | === modified file 'bin/addons/product_attributes/product_attributes.py' | |||
379 | --- bin/addons/product_attributes/product_attributes.py 2021-08-18 14:49:48 +0000 | |||
380 | +++ bin/addons/product_attributes/product_attributes.py 2021-09-27 10:27:25 +0000 | |||
381 | @@ -2737,6 +2737,7 @@ | |||
382 | 2737 | ('composition.kit', 'composition_product_id', _('Composition Kit(s)'), []), | 2737 | ('composition.kit', 'composition_product_id', _('Composition Kit(s)'), []), |
383 | 2738 | ('composition.item', 'item_product_id', _('Composition Kit line(s)'), []), | 2738 | ('composition.item', 'item_product_id', _('Composition Kit line(s)'), []), |
384 | 2739 | ] | 2739 | ] |
385 | 2740 | # please update also doc_field_error_dom in bin/addons/mission_stock/mission_stock.py | ||
386 | 2740 | 2741 | ||
387 | 2741 | for obj, field, msg, dom in doc_field_error_dom: | 2742 | for obj, field, msg, dom in doc_field_error_dom: |
388 | 2742 | nb = self.pool.get(obj).search(cr, uid, [(field, '=', prod_id)]+dom, count=True, context=context) | 2743 | nb = self.pool.get(obj).search(cr, uid, [(field, '=', prod_id)]+dom, count=True, context=context) |
389 | @@ -2755,7 +2756,7 @@ | |||
390 | 2755 | 2756 | ||
391 | 2756 | cr.execute(''' | 2757 | cr.execute(''' |
392 | 2757 | select | 2758 | select |
394 | 2758 | l.product_id | 2759 | l.product_id, array_agg(i.code) |
395 | 2759 | from | 2760 | from |
396 | 2760 | stock_mission_report r, msf_instance i, stock_mission_report_line l | 2761 | stock_mission_report r, msf_instance i, stock_mission_report_line l |
397 | 2761 | where | 2762 | where |
398 | @@ -2764,10 +2765,10 @@ | |||
399 | 2764 | l.mission_report_id = r.id and | 2765 | l.mission_report_id = r.id and |
400 | 2765 | l.product_id in %s and | 2766 | l.product_id in %s and |
401 | 2766 | r.full_view = 'f' and | 2767 | r.full_view = 'f' and |
403 | 2767 | ( l.internal_qty > 0 or l.in_pipe_qty > 0) | 2768 | ( l.internal_qty > 0 or l.in_pipe_qty > 0 or l.used_in_transaction='t') |
404 | 2768 | group by l.product_id | 2769 | group by l.product_id |
405 | 2769 | ''' , (tuple(ids), )) | 2770 | ''' , (tuple(ids), )) |
407 | 2770 | return [x[0] for x in cr.fetchall()] | 2771 | return [(x[0],', '.join(x[1])) for x in cr.fetchall()] |
408 | 2771 | 2772 | ||
409 | 2772 | 2773 | ||
410 | 2773 | def merge_product(self, cr, uid, nsl_prod_id, local_id, context=None): | 2774 | def merge_product(self, cr, uid, nsl_prod_id, local_id, context=None): |
411 | @@ -2782,8 +2783,9 @@ | |||
412 | 2782 | if error_used: | 2783 | if error_used: |
413 | 2783 | raise osv.except_osv(_('Warning'), _('The selected UD product %s has already been used in the past. Merge cannot be done for this product') % (new_data['default_code'], )) | 2784 | raise osv.except_osv(_('Warning'), _('The selected UD product %s has already been used in the past. Merge cannot be done for this product') % (new_data['default_code'], )) |
414 | 2784 | 2785 | ||
417 | 2785 | if self._has_pipe(cr, uid, nsl_prod_id): | 2786 | has_pipe = self._has_pipe(cr, uid, nsl_prod_id) |
418 | 2786 | raise osv.except_osv(_('Warning'), _('Warning there is stock / pipeline in at least one of the instances in this mission! Therefore the product cannot be merged') % (new_data['default_code'], )) | 2787 | if has_pipe: |
419 | 2788 | raise osv.except_osv(_('Warning'), _('Warning there is stock / pipeline in at least one of the instances in this mission! Therefore the product cannot be merged. Instance(s): %s') % (has_pipe[0][1], )) | ||
420 | 2787 | 2789 | ||
421 | 2788 | local_dom = [('id', '=', local_id), ('international_status', '=', 'Local'), ('replaced_by_product_id', '=', False)] | 2790 | local_dom = [('id', '=', local_id), ('international_status', '=', 'Local'), ('replaced_by_product_id', '=', False)] |
422 | 2789 | if not context.get('sync_update_execution'): | 2791 | if not context.get('sync_update_execution'): |
423 | 2790 | 2792 | ||
424 | === modified file 'bin/addons/product_attributes/wizard/product_merged.py' | |||
425 | --- bin/addons/product_attributes/wizard/product_merged.py 2020-05-04 16:40:38 +0000 | |||
426 | +++ bin/addons/product_attributes/wizard/product_merged.py 2021-09-27 10:27:25 +0000 | |||
427 | @@ -26,8 +26,9 @@ | |||
428 | 26 | if error_used: | 26 | if error_used: |
429 | 27 | raise osv.except_osv(_('Warning'), _('The selected UD product has already been used in the past. Merge cannot be done for this product.')) | 27 | raise osv.except_osv(_('Warning'), _('The selected UD product has already been used in the past. Merge cannot be done for this product.')) |
430 | 28 | 28 | ||
433 | 29 | if prod_obj._has_pipe(cr, uid, wiz.new_product_id.id): | 29 | has_pipe = prod_obj._has_pipe(cr, uid, wiz.new_product_id.id) |
434 | 30 | raise osv.except_osv(_('Warning'), _('Warning there is stock / pipeline in at least one of the instances in this mission! Therefore this product cannot be merged.')) | 30 | if has_pipe: |
435 | 31 | raise osv.except_osv(_('Warning'), _('Warning there is stock / pipeline in at least one of the instances in this mission! Therefore this product cannot be merged. Instances: %s') % (has_pipe[0][1], )) | ||
436 | 31 | 32 | ||
437 | 32 | block_msg = prod_obj.check_same_value(cr, uid, wiz.new_product_id.id, wiz.old_product_id.id, blocker=True, context=context) | 33 | block_msg = prod_obj.check_same_value(cr, uid, wiz.new_product_id.id, wiz.old_product_id.id, blocker=True, context=context) |
438 | 33 | if block_msg: | 34 | if block_msg: |