Merge lp:~jfb-tempo-consulting/unifield-server/US-10130 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 6272
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/US-10130
Merge into: lp:unifield-server
Diff against target: 958 lines (+115/-107)
43 files modified
bin/addons/account/account.py (+3/-3)
bin/addons/account/account_move_line.py (+4/-4)
bin/addons/account/invoice.py (+1/-1)
bin/addons/account_override/account.py (+1/-1)
bin/addons/account_override/account_move_line.py (+1/-1)
bin/addons/analytic_distribution/account.py (+4/-4)
bin/addons/analytic_distribution/analytic_line.py (+1/-1)
bin/addons/base/ir/ir_actions.py (+1/-1)
bin/addons/base/ir/workflow/workflow.py (+2/-2)
bin/addons/base/res/partner/partner.py (+7/-7)
bin/addons/consumption_calculation/consumption_calculation.py (+1/-1)
bin/addons/consumption_calculation/expiry_calculation.py (+2/-2)
bin/addons/kit/wizard/process_to_consume.py (+2/-2)
bin/addons/msf_budget/msf_budget_line.py (+1/-1)
bin/addons/msf_budget/report/msf_budget_summary.py (+18/-20)
bin/addons/msf_currency_revaluation/account.py (+4/-2)
bin/addons/msf_field_access_rights/field_access_rule_line.py (+1/-1)
bin/addons/msf_homere_interface/hr.py (+1/-1)
bin/addons/msf_outgoing/msf_outgoing.py (+1/-1)
bin/addons/msf_outgoing/wizard/return_shipment_processor.py (+1/-0)
bin/addons/msf_tools/automated_export_job.py (+1/-0)
bin/addons/msf_tools/automated_import_job.py (+1/-0)
bin/addons/msf_tools/report/report_stock_pipe_per_product_instance.py (+2/-2)
bin/addons/product/product.py (+1/-1)
bin/addons/product_attributes/product_attributes.py (+1/-1)
bin/addons/purchase/purchase_order.py (+1/-1)
bin/addons/purchase/wizard/purchase_line_cancel.py (+1/-1)
bin/addons/purchase_allocation_report/purchase_allocation_report.py (+2/-0)
bin/addons/purchase_compare_rfq/wizard/compare_rfq.py (+1/-0)
bin/addons/register_accounting/account_direct_invoice_wizard.py (+2/-2)
bin/addons/register_accounting/account_move_line.py (+2/-2)
bin/addons/res_currency_functional/account_bank_statement_line_compute_currency.py (+1/-1)
bin/addons/sale/sale_order.py (+5/-9)
bin/addons/sales_followup/sale_followup.py (+1/-1)
bin/addons/sourcing/sale_order_line.py (+3/-6)
bin/addons/stock/stock_move.py (+4/-4)
bin/addons/stock_forecast/wizard/stock_forecast.py (+3/-2)
bin/addons/stock_override/report/report_stock_move.py (+4/-4)
bin/addons/stock_override/stock.py (+3/-3)
bin/addons/stock_override/wizard/stock_card_wizard.py (+1/-1)
bin/addons/supplier_catalogue/product.py (+2/-2)
bin/addons/tender_flow/tender_flow.py (+6/-5)
bin/osv/fields.py (+10/-3)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/US-10130
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+425388@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/account/account.py'
2--- bin/addons/account/account.py 2022-06-22 13:46:44 +0000
3+++ bin/addons/account/account.py 2022-06-24 14:44:08 +0000
4@@ -1270,7 +1270,7 @@
5 'active': fields.boolean('Active', required=True, help="If the active field is set to False, it will allow you to hide the journal period without removing it."),
6 'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'State', required=True, readonly=True,
7 help='When journal period is created. The state is \'Draft\'. If a report is printed it comes to \'Printed\' state. When all transactions are done, it comes in \'Done\' state.'),
8- 'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear'),
9+ 'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear', write_relate=False),
10 'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
11 }
12
13@@ -1418,13 +1418,13 @@
14 'ref': fields.char('Reference', size=64),
15 'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}),
16 'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', type='many2one', relation='account.fiscalyear',
17- string='Fiscal Year', store=False),
18+ string='Fiscal Year', store=False, write_relate=False),
19 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'posted':[('readonly',True)]}),
20 'state': fields.selection([('draft','Unposted'), ('posted','Posted')], 'State', required=True, readonly=True,
21 help='All manually created new journal entry are usually in the state \'Unposted\', but you can set the option to skip that state on the related journal. In that case, they will be behave as journal entries automatically created by the system on document validation (invoices, bank statements...) and will be created in \'Posted\' state.'),
22 'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}),
23 'to_check': fields.boolean('To Review', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.'),
24- 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True),
25+ 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True, write_relate=False),
26 'amount': fields.function(_amount_compute, method=True, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount),
27 'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}, select=True),
28 'narration':fields.text('Narration'),
29
30=== modified file 'bin/addons/account/account_move_line.py'
31--- bin/addons/account/account_move_line.py 2022-04-13 12:17:56 +0000
32+++ bin/addons/account/account_move_line.py 2022-06-24 14:44:08 +0000
33@@ -534,15 +534,15 @@
34 required=True, ondelete="cascade", domain=[('type','<>','view'),
35 ('type', '<>', 'closed')], select=2, hide_default_menu=True),
36 'move_id': fields.many2one('account.move', 'Move', ondelete="cascade", help="The move of this entry line.", select=2, required=True),
37- 'narration': fields.related('move_id','narration', type='text', relation='account.move', string='Narration'),
38- 'ref': fields.related('move_id', 'ref', string='Reference', type='char', size=64, store=True),
39+ 'narration': fields.related('move_id','narration', type='text', relation='account.move', string='Narration', write_relate=False),
40+ 'ref': fields.related('move_id', 'ref', string='Reference', type='char', size=64, store=True, write_relate=False),
41 'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1),
42 'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2),
43 'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2),
44 'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')),
45 'currency_id': fields.many2one('res.currency', 'Currency', help="The optional other currency if it is a multi-currency entry."),
46 'period_id': fields.many2one('account.period', 'Period', required=True, select=2),
47- 'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', type='many2one', relation='account.fiscalyear', string='Fiscal Year', store=False),
48+ 'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', type='many2one', relation='account.fiscalyear', string='Fiscal Year', store=False, write_relate=False),
49 'journal_id': fields.many2one('account.journal', 'Journal', required=True, select=1),
50 'blocked': fields.boolean('Litigation', help="You can check this box to mark this journal item as a litigation with the associated partner"),
51 'partner_id': fields.many2one('res.partner', 'Partner', select=1, ondelete='restrict'),
52@@ -550,7 +550,7 @@
53 'date': fields.related('move_id','date', string='Effective date', type='date', required=True, select=True,
54 store = {
55 'account.move': (_get_move_lines, ['date'], 20)
56- }),
57+ }, readonly=True),
58 'date_created': fields.date('Creation date', select=True),
59 'analytic_lines': fields.one2many('account.analytic.line', 'move_id', 'Analytic lines'),
60 'centralisation': fields.selection([('normal','Normal'),('credit','Credit Centralisation'),('debit','Debit Centralisation'),('currency','Currency Adjustment')], 'Centralisation', size=8),
61
62=== modified file 'bin/addons/account/invoice.py'
63--- bin/addons/account/invoice.py 2022-06-20 12:17:27 +0000
64+++ bin/addons/account/invoice.py 2022-06-24 14:44:08 +0000
65@@ -1674,7 +1674,7 @@
66 'note': fields.text('Notes'),
67 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account'),
68 'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True),
69- 'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True)
70+ 'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True, write_relate=False)
71 }
72 _defaults = {
73 'quantity': 1,
74
75=== modified file 'bin/addons/account_override/account.py'
76--- bin/addons/account_override/account.py 2022-05-08 14:15:29 +0000
77+++ bin/addons/account_override/account.py 2022-06-24 14:44:08 +0000
78@@ -1011,7 +1011,7 @@
79 hide_default_menu=True),
80 'document_date': fields.date('Document Date', size=255, required=True, help="Used for manual journal entries"),
81 'journal_type': fields.related('journal_id', 'type', type='selection', selection=_journal_type_get, string="Journal Type", \
82- help="This indicates which Journal Type is attached to this Journal Entry"),
83+ help="This indicates which Journal Type is attached to this Journal Entry", write_relate=False),
84 'sequence_id': fields.many2one('ir.sequence', string='Lines Sequence', ondelete='cascade',
85 help="This field contains the information related to the numbering of the lines of this journal entry."),
86 'manual_name': fields.char('Description', size=64, required=True),
87
88=== modified file 'bin/addons/account_override/account_move_line.py'
89--- bin/addons/account_override/account_move_line.py 2022-04-27 15:42:49 +0000
90+++ bin/addons/account_override/account_move_line.py 2022-06-24 14:44:08 +0000
91@@ -306,7 +306,7 @@
92 _columns = {
93 'source_date': fields.date('Source date', help="Date used for FX rate re-evaluation"),
94 'move_state': fields.related('move_id', 'state', string="Move state", type="selection", selection=[('draft', 'Unposted'), ('posted', 'Posted')],
95- help="This indicates the state of the Journal Entry."),
96+ help="This indicates the state of the Journal Entry.", write_relate=False),
97 'is_addendum_line': fields.boolean('Is an addendum line?', readonly=True,
98 help="This inform account_reconciliation module that this line is an addendum line for reconciliations."),
99 'move_id': fields.many2one('account.move', 'Entry Sequence', ondelete="cascade", help="The move of this entry line.", select=2, required=True, readonly=True, join=True),
100
101=== modified file 'bin/addons/analytic_distribution/account.py'
102--- bin/addons/analytic_distribution/account.py 2021-09-07 16:24:58 +0000
103+++ bin/addons/analytic_distribution/account.py 2022-06-24 14:44:08 +0000
104@@ -83,7 +83,7 @@
105 _columns = {
106 'account_id': fields.many2one('account.account', "G/L Account", required=True, domain="[('type', '!=', 'view'), ('is_analytic_addicted', '=', True)]", readonly=True, select=1),
107 'destination_id': fields.many2one('account.analytic.account', "Analytical Destination Account", required=True, domain="[('type', '!=', 'view'), ('category', '=', 'DEST')]", readonly=True, select=1),
108- 'destination_code': fields.related('destination_id', 'code', string="Analytical Destination Account", type='char', store=False),
109+ 'destination_code': fields.related('destination_id', 'code', string="Analytical Destination Account", type='char', store=False, write_relate=False),
110 'funding_pool_ids': fields.many2many('account.analytic.account', 'funding_pool_associated_destinations', 'tuple_id', 'funding_pool_id', "Funding Pools"),
111 'name': fields.function(_get_tuple_name, method=True, type='char', size=254, string="Name", readonly=True,
112 store={
113@@ -156,9 +156,9 @@
114 _inherit = 'account.account'
115
116 _columns = {
117- 'user_type_code': fields.related('user_type', 'code', type="char", string="User Type Code", store=False),
118- 'user_type_report_type': fields.related('user_type', 'report_type', type="char", string="User Type Report Type", store=False),
119- 'user_type_name': fields.related('user_type', 'name', type="char", string="User Type Name", store=False),
120+ 'user_type_code': fields.related('user_type', 'code', type="char", string="User Type Code", store=False, write_relate=False),
121+ 'user_type_report_type': fields.related('user_type', 'report_type', type="char", string="User Type Report Type", store=False, write_relate=False),
122+ 'user_type_name': fields.related('user_type', 'name', type="char", string="User Type Name", store=False, write_relate=False),
123 'funding_pool_line_ids': fields.many2many('account.analytic.account', 'funding_pool_associated_accounts', 'account_id', 'funding_pool_id',
124 string='Funding Pools'),
125 'default_destination_id': fields.many2one('account.analytic.account', 'Default Destination', domain="[('type', '!=', 'view'), ('category', '=', 'DEST')]"),
126
127=== modified file 'bin/addons/analytic_distribution/analytic_line.py'
128--- bin/addons/analytic_distribution/analytic_line.py 2022-01-05 15:01:42 +0000
129+++ bin/addons/analytic_distribution/analytic_line.py 2022-06-24 14:44:08 +0000
130@@ -226,7 +226,7 @@
131 help="Indicates the Journal Type of the Analytic journal item"),
132 'entry_sequence': fields.function(_get_entry_sequence, method=True, type='text', string="Entry Sequence", readonly=True, store=True, select=True),
133 'period_id': fields.function(_get_period_id, fnct_search=_search_period_id, method=True, string="Period", readonly=True, type="many2one", relation="account.period", store=False),
134- 'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', type='many2one', relation='account.fiscalyear', string='Fiscal Year', store=False),
135+ 'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', type='many2one', relation='account.fiscalyear', string='Fiscal Year', store=False, write_relate=False),
136 'from_commitment_line': fields.function(_get_from_commitment_line, method=True, type='boolean', string="Commitment?"),
137 'is_unposted': fields.function(_get_is_unposted, method=True, type='boolean', string="Unposted?"),
138 'imported_commitment': fields.boolean(string="From imported commitment?"),
139
140=== modified file 'bin/addons/base/ir/ir_actions.py'
141--- bin/addons/base/ir/ir_actions.py 2021-10-12 16:20:20 +0000
142+++ bin/addons/base/ir/ir_actions.py 2022-06-24 14:44:08 +0000
143@@ -125,7 +125,7 @@
144 # Pending deprecation... to be replaced by report_file as this object will become the default report object (not so specific to RML anymore)
145 'report_rml': fields.char('Main report file path', size=256, help="The path to the main report file (depending on Report Type) or NULL if the content is in another data field"),
146 # temporary related field as report_rml is pending deprecation - this field will replace report_rml after v6.0
147- 'report_file': fields.related('report_rml', type="char", size=256, required=False, readonly=False, string='Report file', help="The path to the main report file (depending on Report Type) or NULL if the content is in another field", store=True),
148+ 'report_file': fields.related('report_rml', type="char", size=256, required=False, readonly=False, string='Report file', help="The path to the main report file (depending on Report Type) or NULL if the content is in another field", store=True, write_relate=True),
149
150 'report_sxw': fields.function(_report_sxw, method=True, type='char', string='SXW path'),
151 'report_sxw_content_data': fields.binary('SXW content'),
152
153=== modified file 'bin/addons/base/ir/workflow/workflow.py'
154--- bin/addons/base/ir/workflow/workflow.py 2018-09-28 15:47:23 +0000
155+++ bin/addons/base/ir/workflow/workflow.py 2022-06-24 14:44:08 +0000
156@@ -161,7 +161,7 @@
157 help="Source activity. When this activity is over, the condition is tested to determine if we can start the ACT_TO activity."),
158 'act_to': fields.many2one('workflow.activity', 'Destination Activity', required=True, select=True, ondelete='cascade',
159 help="The destination activity."),
160- 'wkf_id': fields.related('act_from','wkf_id', type='many2one', relation='workflow', string='Workflow', select=True),
161+ 'wkf_id': fields.related('act_from','wkf_id', type='many2one', relation='workflow', string='Workflow', select=True, write_relate=False),
162 'sequence': fields.integer('Sequence'),
163 }
164 _defaults = {
165@@ -203,7 +203,7 @@
166 _rec_name = 'state'
167 _columns = {
168 'act_id': fields.many2one('workflow.activity', 'Activity', required=True, ondelete="restrict", select=True),
169- 'wkf_id': fields.related('act_id','wkf_id', type='many2one', relation='workflow', string='Workflow'),
170+ 'wkf_id': fields.related('act_id','wkf_id', type='many2one', relation='workflow', string='Workflow', write_relate=False),
171 'subflow_id': fields.many2one('workflow.instance', 'Subflow', ondelete="cascade", select=True),
172 'inst_id': fields.many2one('workflow.instance', 'Instance', required=True, ondelete="cascade", select=True),
173 'state': fields.char('State', size=64, select=True),
174
175=== modified file 'bin/addons/base/res/partner/partner.py'
176--- bin/addons/base/res/partner/partner.py 2022-02-02 17:13:29 +0000
177+++ bin/addons/base/res/partner/partner.py 2022-06-24 14:44:08 +0000
178@@ -132,12 +132,12 @@
179 'active': fields.boolean('Active'),
180 'customer': fields.boolean('Customer', help="Check this box if the partner is a customer."),
181 'supplier': fields.boolean('Supplier', help="Check this box if the partner is a supplier. If it's not checked, purchase people will not see it when encoding a purchase order."),
182- 'city': fields.related('address', 'city', type='char', string='City'),
183- 'phone': fields.related('address', 'phone', type='char', string='Phone'),
184- 'mobile': fields.related('address', 'mobile', type='char', string='Mobile'),
185- 'country': fields.related('address', 'country_id', type='many2one', relation='res.country', string='Country'),
186+ 'city': fields.related('address', 'city', type='char', string='City', write_relate=True),
187+ 'phone': fields.related('address', 'phone', type='char', string='Phone', write_relate=True),
188+ 'mobile': fields.related('address', 'mobile', type='char', string='Mobile', write_relate=True),
189+ 'country': fields.related('address', 'country_id', type='many2one', relation='res.country', string='Country', write_relate=True),
190 'employee': fields.boolean('Employee', help="Check this box if the partner is an Employee."),
191- 'email': fields.related('address', 'email', type='char', size=240, string='E-mail'),
192+ 'email': fields.related('address', 'email', type='char', size=240, string='E-mail', write_relate=True),
193 'company_id': fields.many2one('res.company', 'Company', select=1),
194 }
195
196@@ -322,8 +322,8 @@
197 'fax': fields.char('Fax', size=64),
198 'mobile': fields.char('Mobile', size=64),
199 'birthdate': fields.char('Birthdate', size=64),
200- 'is_customer_add': fields.related('partner_id', 'customer', type='boolean', string='Customer'),
201- 'is_supplier_add': fields.related('partner_id', 'supplier', type='boolean', string='Supplier'),
202+ 'is_customer_add': fields.related('partner_id', 'customer', type='boolean', string='Customer', write_relate=False),
203+ 'is_supplier_add': fields.related('partner_id', 'supplier', type='boolean', string='Supplier', write_relate=False),
204 'active': fields.boolean('Active', help="Uncheck the active field to hide the contact."),
205 # 'company_id': fields.related('partner_id','company_id',type='many2one',relation='res.company',string='Company', store=True),
206 'company_id': fields.many2one('res.company', 'Company',select=1),
207
208=== modified file 'bin/addons/consumption_calculation/consumption_calculation.py'
209--- bin/addons/consumption_calculation/consumption_calculation.py 2022-02-08 09:54:01 +0000
210+++ bin/addons/consumption_calculation/consumption_calculation.py 2022-06-24 14:44:08 +0000
211@@ -1579,7 +1579,7 @@
212 'valid_until': fields.date(string='Valid until'),
213 'valid_ok': fields.boolean(string='Validated', readonly=False),
214 'mrc_id': fields.many2one('monthly.review.consumption', string='MRC', required=True, ondelete='cascade'),
215- 'mrc_creation_date': fields.related('mrc_id', 'creation_date', type='date', store=True),
216+ 'mrc_creation_date': fields.related('mrc_id', 'creation_date', type='date', store=True, write_relate=False),
217 'text_error': fields.text('Errors', readonly=True),
218 'to_correct_ok': fields.function(_get_checks_all, method=True, type="boolean", string="To correct", store=False, readonly=True, multi="m"),
219 }
220
221=== modified file 'bin/addons/consumption_calculation/expiry_calculation.py'
222--- bin/addons/consumption_calculation/expiry_calculation.py 2021-09-22 13:49:41 +0000
223+++ bin/addons/consumption_calculation/expiry_calculation.py 2022-06-24 14:44:08 +0000
224@@ -192,7 +192,7 @@
225 'product_id': fields.many2one('product.product', string='Product', required=True),
226 'product_code': fields.char(string='Ref.', size=64, required=True),
227 'product_name': fields.char(string='Name', size=128, required=True),
228- 'uom_id': fields.related('product_id', 'uom_id', string='UoM', type='many2one', relation='product.uom'),
229+ 'uom_id': fields.related('product_id', 'uom_id', string='UoM', type='many2one', relation='product.uom', write_relate=False),
230 'real_stock': fields.float(digits=(16, 2), string='Real stock', related_uom='uom_id'),
231 'expired_qty': fields.float(digits=(16, 2), string='Batch exp.', related_uom='uom_id'),
232 'batch_number': fields.char(size=64, string='Batch'),
233@@ -912,7 +912,7 @@
234 'location_id': fields.many2one('stock.location', string='Location'),
235 'available_qty': fields.float(digits=(16,2), string='Available Qty.', related_uom='uom_id'),
236 'expired_qty': fields.float(digits=(16,2), string='Expired Qty.', related_uom='uom_id'),
237- 'expired_date': fields.related('lot_id', 'life_date', type='date', string='Expiry date', store=True),
238+ 'expired_date': fields.related('lot_id', 'life_date', type='date', string='Expiry date', store=True, write_relate=False),
239 'uom_id': fields.many2one('product.uom', string='UoM'),
240 }
241
242
243=== modified file 'bin/addons/kit/wizard/process_to_consume.py'
244--- bin/addons/kit/wizard/process_to_consume.py 2021-07-07 16:30:21 +0000
245+++ bin/addons/kit/wizard/process_to_consume.py 2022-06-24 14:44:08 +0000
246@@ -196,8 +196,8 @@
247 'total_selected_qty_process_to_consume': fields.function(_vals_get, method=True, type='float', string='Total Selected Qty', multi='get_vals', store=False, readonly=True),
248 'qty_available_process_to_consume': fields.function(_vals_get, method=True, type='float', string='Available Qty', multi='get_vals', store=False),
249 # related
250- 'line_number_process_to_consume': fields.related('to_consume_id_process_to_consume', 'line_number_to_consume', type='integer', string='Line'),
251- 'consider_child_locations_process_to_consume': fields.related('kit_creation_id_process_to_consume', 'consider_child_locations_kit_creation', type='boolean', string='Consider Child Location'),
252+ 'line_number_process_to_consume': fields.related('to_consume_id_process_to_consume', 'line_number_to_consume', type='integer', string='Line', write_relate=False),
253+ 'consider_child_locations_process_to_consume': fields.related('kit_creation_id_process_to_consume', 'consider_child_locations_kit_creation', type='boolean', string='Consider Child Location', write_relate=False),
254 }
255
256 process_to_consume_line()
257
258=== modified file 'bin/addons/msf_budget/msf_budget_line.py'
259--- bin/addons/msf_budget/msf_budget_line.py 2020-02-13 14:50:37 +0000
260+++ bin/addons/msf_budget/msf_budget_line.py 2022-06-24 14:44:08 +0000
261@@ -403,7 +403,7 @@
262 'line_type': fields.selection([('view','View'),
263 ('normal','Normal'),
264 ('destination', 'Destination')], 'Line type', required=True),
265- 'account_code': fields.related('account_id', 'code', type='char', string='Account code', size=64, store=True),
266+ 'account_code': fields.related('account_id', 'code', type='char', string='Account code', size=64, store=True, write_relate=False),
267 'account_order': fields.function(_get_account_order, type='integer', string='order', method=True, store=True),
268 }
269
270
271=== modified file 'bin/addons/msf_budget/report/msf_budget_summary.py'
272--- bin/addons/msf_budget/report/msf_budget_summary.py 2015-09-11 14:50:11 +0000
273+++ bin/addons/msf_budget/report/msf_budget_summary.py 2022-06-24 14:44:08 +0000
274@@ -26,12 +26,12 @@
275 # US-583: exclude chars in action name
276 # (chars to exclude list obtained using string.printable and testing)
277 exclude_list = "\"'`^\@~;$&#"
278-
279+
280 res = text
281 for c in exclude_list:
282 res = res.replace(c, '')
283 return res
284-
285+
286
287 class msf_budget_summary(osv.osv_memory):
288 _name = "msf.budget.summary"
289@@ -85,8 +85,8 @@
290 _columns = {
291 'budget_id': fields.many2one('msf.budget', 'Budget', required=True),
292
293- 'name': fields.related('budget_id', 'name', type="char", string="Budget Name", store=False),
294- 'code': fields.related('budget_id', 'code', type="char", string="Budget Code", store=False),
295+ 'name': fields.related('budget_id', 'name', type="char", string="Budget Name", store=False, write_relate=False),
296+ 'code': fields.related('budget_id', 'code', type="char", string="Budget Code", store=False, write_relate=False),
297 'budget_amount': fields.function(_get_amounts, method=True, store=False, string="Budget Amount", type="float", multi="all"),
298 'actual_amount': fields.function(_get_amounts, method=True, store=False, string="Actual Amount", type="float", multi="all"),
299 'balance_amount': fields.function(_get_amounts, method=True, store=False, string="Balance Amount", type="float", multi="all"), # utp-857
300@@ -138,7 +138,6 @@
301 if context is None:
302 context = {}
303
304- mb_obj = self.pool.get('msf.budget')
305 mbs_obj = self.pool.get('msf.budget.summary')
306 mbsl_obj = self.pool.get('msf.budget.summary.line')
307
308@@ -153,13 +152,13 @@
309
310 # get summary line data and do checks
311 summary_br = mbs_obj.browse(cr, uid, [summary_line_id],
312- context=context)[0]
313+ context=context)[0]
314 # abort if no budget found or not a last level summary node (perfs)
315 if not summary_br.budget_id:
316 raise osv.except_osv(_('Error'), _('Budget not found'))
317 if summary_br.child_ids:
318 raise osv.except_osv(_('Warning'),
319- _('Only childest budgets are drillable'))
320+ _('Only childest budgets are drillable'))
321
322 # build tree
323 root_id = mbsl_obj.build_tree(cr, uid, summary_br, context=context)
324@@ -168,7 +167,7 @@
325 name = self._budget_summary_line_label_pattern.format(
326 budget_code=summary_br.budget_id.code or '')
327 view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid,
328- 'msf_budget', 'view_msf_budget_summary_budget_line_tree')[1]
329+ 'msf_budget', 'view_msf_budget_summary_budget_line_tree')[1]
330 res = {
331 'name': filter_chars(name),
332 'type': 'ir.actions.act_window',
333@@ -196,7 +195,7 @@
334 return res
335
336 for r in self.read(cr, uid, ids, ['parent_id', 'name'],
337- context=context):
338+ context=context):
339 if r['parent_id']:
340 parts = r['name'].split(' ')
341 res[r['id']] = parts and parts[0] or ''
342@@ -225,16 +224,16 @@
343 def build_tree(self, cr, uid, summary_line_br, context=None):
344 aa_obj = self.pool.get('account.account')
345 mbl_obj = self.pool.get('msf.budget.line')
346-
347+
348 if context is None:
349 context = {}
350 context['commitment'] = 1
351-
352+
353 # get account tree
354 account_ids = aa_obj.search(cr, uid, [])
355 account_tree = {}
356 for a in aa_obj.read(cr, uid, account_ids, ['parent_id', ],
357- context=context):
358+ context=context):
359 account_tree[a['id']] = a['parent_id'] and a['parent_id'][0] \
360 or False
361
362@@ -254,7 +253,6 @@
363
364 # build nodes from budget lines
365 id = False
366- parent_level_ids = {}
367 fields = [ 'name', 'budget_amount', 'actual_amount', 'balance', ]
368
369 budget_lines_ids = mbl_obj.search(cr, uid, [
370@@ -264,21 +262,21 @@
371
372 # mapping between build tree lines and budget lines by account
373 mapping = {}
374-
375+
376 # get line truely in parent_left order
377 # (the native order of budget lines)
378 line_read = {}
379 for bl_r in mbl_obj.read(cr, uid, budget_lines_ids,
380- fields + [ 'account_id', 'comm_amount', ], context=context):
381+ fields + [ 'account_id', 'comm_amount', ], context=context):
382 line_read[bl_r['id']] = bl_r
383-
384+
385 for bl_id in budget_lines_ids:
386 bl_r = line_read[bl_id]
387
388 # get account level
389 parts = bl_r['name'].split(' ')
390 account = parts and parts[0] or ''
391-
392+
393 # parent mapping
394 account_id = bl_r['account_id'][0]
395 parent_id = root_id
396@@ -306,13 +304,13 @@
397 mapping[account_id] = id
398 if not id:
399 break
400-
401+
402 return root_id
403
404 def action_open_analytic_lines(self, cr, uid, ids, context):
405 def get_analytic_domain(sl_br):
406 cc_ids = self.pool.get('msf.budget.tools')._get_cost_center_ids(cr,
407- uid, sl_br.budget_id.cost_center_id)
408+ uid, sl_br.budget_id.cost_center_id)
409
410 return [
411 ('cost_center_id', 'in', cc_ids),
412@@ -334,7 +332,7 @@
413 if not sl_br.budget_line_id:
414 # no AJI drill for the root line: only from 1 level (like 6, 7)
415 raise osv.except_osv(_('Warning'),
416- _('You can not drill analytic journal items of the root line'))
417+ _('You can not drill analytic journal items of the root line'))
418 name = self._aji_label_pattern.format(
419 budget_code=sl_br.budget_id.code or '',
420 budget_line=sl_br.name or '')
421
422=== modified file 'bin/addons/msf_currency_revaluation/account.py'
423--- bin/addons/msf_currency_revaluation/account.py 2018-06-27 15:16:16 +0000
424+++ bin/addons/msf_currency_revaluation/account.py 2022-06-24 14:44:08 +0000
425@@ -54,10 +54,12 @@
426 string=_("Included in revaluation?")),
427 'user_type_code': fields.related(
428 'user_type', 'code',
429- type='char', string=_(u"Type (code)")),
430+ type='char', string=_(u"Type (code)"),
431+ write_relate=False),
432 'instance_level': fields.related(
433 'company_id', 'instance_id', 'level',
434- type='char', string=_(u"Instance level")),
435+ type='char', string=_(u"Instance level"),
436+ write_relate=False),
437 }
438
439 _defaults = {'currency_revaluation': False}
440
441=== modified file 'bin/addons/msf_field_access_rights/field_access_rule_line.py'
442--- bin/addons/msf_field_access_rights/field_access_rule_line.py 2018-10-08 09:23:31 +0000
443+++ bin/addons/msf_field_access_rights/field_access_rule_line.py 2022-06-24 14:44:08 +0000
444@@ -46,7 +46,7 @@
445 'value_not_synchronized_on_write': fields.boolean('Value NOT Synchronised on Write', help='If checked, the value for this field given by a synchronisation or import is ignored when this record is editted.'),
446
447 'field_access_rule': fields.many2one('msf_field_access_rights.field_access_rule', 'Field Access Rule', ondelete='cascade', required=True),
448- 'field_access_rule_model_id': fields.related('field_access_rule', 'model_id', type="integer", string='Field Model')
449+ 'field_access_rule_model_id': fields.related('field_access_rule', 'model_id', type="integer", string='Field Model', write_relate=False)
450 }
451
452 _defaults = {
453
454=== modified file 'bin/addons/msf_homere_interface/hr.py'
455--- bin/addons/msf_homere_interface/hr.py 2020-10-05 15:38:34 +0000
456+++ bin/addons/msf_homere_interface/hr.py 2022-06-24 14:44:08 +0000
457@@ -142,7 +142,7 @@
458 'homere_uuid_key': fields.char(string='Homere field: UUID_key', size=64, readonly=True, required=False),
459 'gender': fields.selection([('male', 'Male'),('female', 'Female'), ('unknown', 'Unknown')], 'Gender'),
460 'private_phone': fields.char(string='Private Phone', size=32),
461- 'name_resource': fields.related('resource_id', 'name', string="Name", type='char', size=128, store=True),
462+ 'name_resource': fields.related('resource_id', 'name', string="Name", type='char', size=128, store=True, write_relate=False),
463 'destination_id': fields.many2one('account.analytic.account', string="Destination", domain="[('category', '=', 'DEST'), ('type', '!=', 'view'), ('state', '=', 'open')]"),
464 'allow_edition': fields.function(_get_allow_edition, method=True, type='boolean', store=False, string="Allow local employee edition?", readonly=True),
465 'photo': fields.binary('Photo', readonly=True),
466
467=== modified file 'bin/addons/msf_outgoing/msf_outgoing.py'
468--- bin/addons/msf_outgoing/msf_outgoing.py 2022-04-05 07:24:53 +0000
469+++ bin/addons/msf_outgoing/msf_outgoing.py 2022-06-24 14:44:08 +0000
470@@ -2393,7 +2393,7 @@
471 'in_ref': fields.char(string='IN Reference', size=1024),
472 'from_manage_expired': fields.boolean(string='The Picking was created with Manage Expired Stock'),
473 'requestor': fields.char(size=128, string='Requestor'),
474- 'from_ir': fields.related('sale_id', 'procurement_request', type='boolean', relation='sale.order', string='Is the linked Sale Order IR'),
475+ 'from_ir': fields.related('sale_id', 'procurement_request', type='boolean', relation='sale.order', string='Is the linked Sale Order IR', write_relate=False),
476 }
477
478 _defaults = {
479
480=== modified file 'bin/addons/msf_outgoing/wizard/return_shipment_processor.py'
481--- bin/addons/msf_outgoing/wizard/return_shipment_processor.py 2019-11-22 14:06:38 +0000
482+++ bin/addons/msf_outgoing/wizard/return_shipment_processor.py 2022-06-24 14:44:08 +0000
483@@ -61,6 +61,7 @@
484 type='many2one',
485 relation='res.partner',
486 string='Customer',
487+ write_relate=False,
488 ),
489 'step': fields.selection(
490 string='Step',
491
492=== modified file 'bin/addons/msf_tools/automated_export_job.py'
493--- bin/addons/msf_tools/automated_export_job.py 2020-09-25 09:25:57 +0000
494+++ bin/addons/msf_tools/automated_export_job.py 2022-06-24 14:44:08 +0000
495@@ -312,6 +312,7 @@
496 'export_id': fields.related(
497 'automated.export',
498 string='Export',
499+ write_relate=False,
500 ),
501 }
502
503
504=== modified file 'bin/addons/msf_tools/automated_import_job.py'
505--- bin/addons/msf_tools/automated_import_job.py 2021-04-13 16:03:28 +0000
506+++ bin/addons/msf_tools/automated_import_job.py 2022-06-24 14:44:08 +0000
507@@ -698,6 +698,7 @@
508 'import_id': fields.related(
509 'automated.import',
510 string='Import',
511+ write_relate=False,
512 ),
513 }
514
515
516=== modified file 'bin/addons/msf_tools/report/report_stock_pipe_per_product_instance.py'
517--- bin/addons/msf_tools/report/report_stock_pipe_per_product_instance.py 2020-11-02 09:51:10 +0000
518+++ bin/addons/msf_tools/report/report_stock_pipe_per_product_instance.py 2022-06-24 14:44:08 +0000
519@@ -139,9 +139,9 @@
520 _columns = {
521 'stock_pipe_per_product_instance_id': fields.many2one('stock.pipe.per.product.instance', string='Report Stock & Pipe per Product and per Instance'),
522 'product_id': fields.many2one('product.product', string='Product'),
523- 'uom_id': fields.related('product_id', 'uom_id', type='many2one', relation='product.uom', store=True, string='UoM'),
524+ 'uom_id': fields.related('product_id', 'uom_id', type='many2one', relation='product.uom', store=True, string='UoM', write_relate=False),
525 'instance_id': fields.many2one('msf.instance', 'Instance/Mission'),
526- 'uf_state': fields.related('product_id', 'state', type='many2one', relation='product.status', store=True, string='HQ UniField Status'),
527+ 'uf_state': fields.related('product_id', 'state', type='many2one', relation='product.status', store=True, string='HQ UniField Status', write_relate=False),
528 'ud_state': fields.related('product_id', 'state_ud', type='selection', selection=[('valid', 'Valid'), ('outdated', 'Outdated'), ('discontinued', 'Discontinued'), ('phase_out', 'Phase Out'), ('stopped', 'Stopped'), ('archived', 'Archived'), ('forbidden', 'Forbidden')], store=True, write_relate=False, string='HQ UniData Status'),
529 'instance_stock': fields.float('Instance stock', related_uom='uom_id'),
530 'pipe_qty': fields.float('Pipeline Qty', related_uom='uom_id'),
531
532=== modified file 'bin/addons/product/product.py'
533--- bin/addons/product/product.py 2021-08-06 15:49:01 +0000
534+++ bin/addons/product/product.py 2022-06-24 14:44:08 +0000
535@@ -1005,7 +1005,7 @@
536 'product_name': fields.char('Supplier Product Name', size=128, help="This supplier's product name will be used when printing a request for quotation. Keep empty to use the internal one."),
537 'product_code': fields.char('Supplier Product Code', size=64, help="This supplier's product code will be used when printing a request for quotation. Keep empty to use the internal one."),
538 'sequence' : fields.integer('Sequence', help="Assigns the priority to the list of product supplier."),
539- 'product_uom': fields.related('product_id', 'uom_id', string="Supplier UoM", type='many2one', relation='product.uom', help="Choose here the Unit of Measure in which the prices and quantities are expressed below."),
540+ 'product_uom': fields.related('product_id', 'uom_id', string="Supplier UoM", type='many2one', relation='product.uom', help="Choose here the Unit of Measure in which the prices and quantities are expressed below.", write_relate=False),
541 'min_qty': fields.float('Minimal Quantity', required=False, help="The minimal quantity to purchase to this supplier, expressed in the supplier Product UoM if not empty, in the default unit of measure of the product otherwise.", related_uom='product_uom'),
542 'qty': fields.function(_calc_qty, method=True, store=True, type='float', string='Quantity', multi="qty", help="This is a quantity which is converted into Default Uom.", related_uom='product_uom'),
543 'product_id' : fields.many2one('product.template', 'Product', required=True, ondelete='cascade', select=True),
544
545=== modified file 'bin/addons/product_attributes/product_attributes.py'
546--- bin/addons/product_attributes/product_attributes.py 2022-04-01 08:58:53 +0000
547+++ bin/addons/product_attributes/product_attributes.py 2022-06-24 14:44:08 +0000
548@@ -994,7 +994,7 @@
549 'product.product': (lambda self, cr, uid, ids, c=None: ids, ['controlled_substance'], 10),
550 }
551 ),
552- 'uom_category_id': fields.related('uom_id', 'category_id', string='Uom Category', type='many2one', relation='product.uom.categ'),
553+ 'uom_category_id': fields.related('uom_id', 'category_id', string='Uom Category', type='many2one', relation='product.uom.categ', write_relate=False),
554 'no_external': fields.function(_get_restriction, method=True, type='boolean', string='External partners orders', readonly=True, multi='restriction',
555 store={'product.product': (lambda self, cr, uid, ids, c=None: ids, ['international_status', 'state'], 20),
556 'product.status': (_get_product_status, ['no_external'], 10),
557
558=== modified file 'bin/addons/purchase/purchase_order.py'
559--- bin/addons/purchase/purchase_order.py 2022-03-22 09:01:13 +0000
560+++ bin/addons/purchase/purchase_order.py 2022-06-24 14:44:08 +0000
561@@ -841,7 +841,7 @@
562 'unallocation_ok': fields.boolean(string='Unallocated PO'),
563 'partner_ref': fields.char('Supplier Reference', size=128),
564 'short_partner_ref': fields.function(_get_short_partner_ref, method=True, string='Supplier Reference', type='char', size=64, store=False),
565- 'product_id': fields.related('order_line', 'product_id', type='many2one', relation='product.product', string='Product'),
566+ 'product_id': fields.related('order_line', 'product_id', type='many2one', relation='product.product', string='Product', write_relate=False),
567 'no_line': fields.function(_get_no_line, method=True, type='boolean', string='No line'),
568 'active': fields.boolean('Active', readonly=True),
569 'po_from_ir': fields.function(_po_from_x, method=True, type='boolean', string='Is PO from IR ?', multi='po_from_x'),
570
571=== modified file 'bin/addons/purchase/wizard/purchase_line_cancel.py'
572--- bin/addons/purchase/wizard/purchase_line_cancel.py 2018-09-05 07:52:27 +0000
573+++ bin/addons/purchase/wizard/purchase_line_cancel.py 2022-06-24 14:44:08 +0000
574@@ -28,7 +28,7 @@
575
576 _columns = {
577 'pol_id': fields.many2one('purchase.order.line', string='PO line to delete'),
578- 'linked_sol_id': fields.related('pol_id', 'linked_sol_id', type='many2one', relation='sale.order.line', string='SO line'),
579+ 'linked_sol_id': fields.related('pol_id', 'linked_sol_id', type='many2one', relation='sale.order.line', string='SO line', write_relate=False),
580 }
581
582 def cancel_pol(self, cr, uid, ids, resource=False, context=None):
583
584=== modified file 'bin/addons/purchase_allocation_report/purchase_allocation_report.py'
585--- bin/addons/purchase_allocation_report/purchase_allocation_report.py 2018-09-17 16:14:57 +0000
586+++ bin/addons/purchase_allocation_report/purchase_allocation_report.py 2022-06-24 14:44:08 +0000
587@@ -71,6 +71,7 @@
588 size=64,
589 string='Product Code',
590 store=False,
591+ write_relate=False,
592 ),
593 'product_name': fields.related(
594 'product_id',
595@@ -79,6 +80,7 @@
596 size=128,
597 string='Product Name',
598 store=False,
599+ write_relate=False,
600 ),
601 'product_qty': fields.float(digits=(16,2), string='Qty', related_uom='uom_id'),
602 'uom_id': fields.many2one('product.uom', string='UoM'),
603
604=== modified file 'bin/addons/purchase_compare_rfq/wizard/compare_rfq.py'
605--- bin/addons/purchase_compare_rfq/wizard/compare_rfq.py 2020-05-15 14:18:40 +0000
606+++ bin/addons/purchase_compare_rfq/wizard/compare_rfq.py 2022-06-24 14:44:08 +0000
607@@ -436,6 +436,7 @@
608 string='Selected supplier',
609 type='char',
610 size=256,
611+ write_relate=False,
612 ),
613 }
614
615
616=== modified file 'bin/addons/register_accounting/account_direct_invoice_wizard.py'
617--- bin/addons/register_accounting/account_direct_invoice_wizard.py 2022-04-11 13:41:22 +0000
618+++ bin/addons/register_accounting/account_direct_invoice_wizard.py 2022-06-24 14:44:08 +0000
619@@ -84,7 +84,7 @@
620 readonly=True, states={'draft':[('readonly',False)]}),
621 'number': fields.related('move_id','name', type='char',
622 readonly=True, size=64, relation='account.move', store=True,
623- string='Number'),
624+ string='Number', write_relate=False),
625 'origin': fields.char('Source Document', size=512,
626 help="Referencie of the document that produced this invoice.",
627 readonly=True, states={'draft':[('readonly',False)]}),
628@@ -626,7 +626,7 @@
629 'company_id': fields.related('invoice_wizard_id','company_id',type='many2one',
630 relation='res.company', string='Company', store=True, readonly=True),
631 'partner_id': fields.related('invoice_wizard_id','partner_id',type='many2one',
632- relation='res.partner', string='Partner',store=True),
633+ relation='res.partner', string='Partner',store=True, write_relate=False),
634 'inactive_error': fields.function(_get_inactive_product, method=True,
635 type='char', string='Comment', store=False, multi='inactive'),
636 'newline': fields.boolean('New line'),
637
638=== modified file 'bin/addons/register_accounting/account_move_line.py'
639--- bin/addons/register_accounting/account_move_line.py 2020-02-13 14:50:37 +0000
640+++ bin/addons/register_accounting/account_move_line.py 2022-06-24 14:44:08 +0000
641@@ -246,7 +246,7 @@
642 'third_parties': fields.function(_get_third_parties, type='reference', method=True,
643 string="Third Parties", selection=[('res.partner', 'Partner'), ('account.journal', 'Journal'), ('hr.employee', 'Employee')],
644 help="To use for python code when registering", multi="third_parties_key"),
645- 'supplier_invoice_ref': fields.related('invoice', 'name', type='char', size=64, string="Supplier inv.ref.", store=False),
646+ 'supplier_invoice_ref': fields.related('invoice', 'name', type='char', size=64, string="Supplier inv.ref.", store=False, write_relate=False),
647 'imported_invoice_line_ids': fields.many2many('account.bank.statement.line', 'imported_invoice', 'move_line_id', 'st_line_id',
648 string="Imported Invoices", required=False, readonly=True),
649 'from_import_invoice_ml_id': fields.many2one('account.move.line', 'From import invoice', select=1,
650@@ -265,7 +265,7 @@
651 'account.bank.statement.line': (_get_linked_statement, None, 10),
652 }),
653 'partner_txt': fields.text(string="Third Parties", help="Help user to display and sort Third Parties"),
654- 'partner_identification': fields.related('employee_id', 'identification_id', type='char', string='Id No', size=32),
655+ 'partner_identification': fields.related('employee_id', 'identification_id', type='char', string='Id No', size=32, write_relate=False),
656 'down_payment_id': fields.many2one('purchase.order', string="Purchase Order for Down Payment", readonly=True, ondelete='cascade'),
657 'down_payment_amount': fields.float(string='Down Payment used amount', readonly=True),
658 'transfer_amount': fields.float(string="Transfer amount", readonly=True, required=False),
659
660=== modified file 'bin/addons/res_currency_functional/account_bank_statement_line_compute_currency.py'
661--- bin/addons/res_currency_functional/account_bank_statement_line_compute_currency.py 2019-10-30 16:33:21 +0000
662+++ bin/addons/res_currency_functional/account_bank_statement_line_compute_currency.py 2022-06-24 14:44:08 +0000
663@@ -50,7 +50,7 @@
664 return res
665
666 _columns = {
667- 'currency_id': fields.related('statement_id', 'currency', type="many2one", relation="res.currency", string="Currency", store=False),
668+ 'currency_id': fields.related('statement_id', 'currency', type="many2one", relation="res.currency", string="Currency", store=False, write_relate=False),
669 'functional_in': fields.function(_compute, method=True, store=False, type='float', string='Func. In', multi='amount_in, amount_out'),
670 'functional_out': fields.function(_compute, method=True, store=False, type='float', string='Func. Out', multi='amount_in, amount_out'),
671 'functional_currency_id': fields.related('company_id', 'currency_id', type="many2one", relation="res.currency", string="Func. Currency", store=False, write_relate=False),
672
673=== modified file 'bin/addons/sale/sale_order.py'
674--- bin/addons/sale/sale_order.py 2022-06-20 12:17:27 +0000
675+++ bin/addons/sale/sale_order.py 2022-06-24 14:44:08 +0000
676@@ -694,7 +694,7 @@
677 'split_type_sale_order': fields.selection(SALE_ORDER_SPLIT_SELECTION, required=True, readonly=True, internal=1),
678 'original_so_id_sale_order': fields.many2one('sale.order', 'Original Field Order', readonly=True),
679 'active': fields.boolean('Active', readonly=True),
680- 'product_id': fields.related('order_line', 'product_id', type='many2one', relation='product.product', string='Product'),
681+ 'product_id': fields.related('order_line', 'product_id', type='many2one', relation='product.product', string='Product', write_relate=False),
682 'no_line': fields.function(_get_no_line, method=True, type='boolean', string='No line'),
683 'manually_corrected': fields.function(_get_manually_corrected, method=True, type='boolean', string='Manually corrected'),
684 'is_a_counterpart': fields.boolean('Counterpart?', help="This field is only for indicating that the order is a counterpart"),
685@@ -2211,8 +2211,8 @@
686 'display_resourced_orig_line': fields.function(_get_display_resourced_orig_line, method=True, type='char', readonly=True, string='Original FO/IR line', help='Original line from which the current one has been cancel and ressourced'),
687 'resourced_at_state': fields.char('Resourced at state', size=128, help='The state of the original line when the resourced line has been created'),
688 'stock_take_date': fields.date('Date of Stock Take', required=False),
689- 'order_partner_id': fields.related('order_id', 'partner_id', type='many2one', relation='res.partner', store=True, string='Customer'),
690- 'salesman_id':fields.related('order_id', 'user_id', type='many2one', relation='res.users', store=True, string='Salesman'),
691+ 'order_partner_id': fields.related('order_id', 'partner_id', type='many2one', relation='res.partner', store=True, string='Customer', write_relate=False),
692+ 'salesman_id':fields.related('order_id', 'user_id', type='many2one', relation='res.users', store=True, string='Salesman', write_relate=False),
693 'company_id': fields.related('order_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True),
694 'is_line_split': fields.boolean(string='This line is a split line?'), # UTP-972: Use boolean to indicate if the line is a split line
695 'partner_id': fields.related('order_id', 'partner_id', relation="res.partner", readonly=True, type="many2one", string="Customer"),
696@@ -3845,12 +3845,7 @@
697 string='Purchase order line',
698 ondelete='cascade',
699 ),
700- 'po_id': fields.related(
701- 'po_line_id',
702- 'order_id',
703- type='many2one',
704- relation='purchase.order',
705- ),
706+ 'po_id': fields.related('po_line_id', 'order_id', type='many2one', relation='purchase.order', write_relate=False),
707 }
708
709 expected_sale_order_line()
710@@ -4036,6 +4031,7 @@
711 type='selection',
712 string='Order state',
713 selection=SALE_ORDER_STATE_SELECTION,
714+ write_relate=False,
715 ),
716 'action': fields.selection(
717 selection=[
718
719=== modified file 'bin/addons/sales_followup/sale_followup.py'
720--- bin/addons/sales_followup/sale_followup.py 2021-03-19 17:44:09 +0000
721+++ bin/addons/sales_followup/sale_followup.py 2022-06-24 14:44:08 +0000
722@@ -739,7 +739,7 @@
723 'procure_method': fields.related('line_id', 'type', type='selection', selection=[('make_to_stock','From stock'), ('make_to_order','On order')], readonly=True, string='Proc. Method'),
724 'po_cft': fields.related('line_id', 'po_cft', type='selection', selection=[('po','PO'), ('dpo', 'DPO'), ('cft','CFT'), ('pli', 'PLI')], readonly=True, string='PO/CFT'),
725 'line_number': fields.related('line_id', 'line_number', string='Order line', readonly=True, type='integer'),
726- 'product_id': fields.related('line_id', 'product_id', string='Product Code', readondy=True,
727+ 'product_id': fields.related('line_id', 'product_id', string='Product Code', readonly=True,
728 type='many2one', relation='product.product'),
729 'qty_ordered': fields.related('line_id', 'product_uom_qty', string='Ordered qty', readonly=True, related_uom='uom_id'),
730 'uom_id': fields.related('line_id', 'product_uom', type='many2one', relation='product.uom', string='UoM', readonly=True),
731
732=== modified file 'bin/addons/sourcing/sale_order_line.py'
733--- bin/addons/sourcing/sale_order_line.py 2021-10-26 13:50:13 +0000
734+++ bin/addons/sourcing/sale_order_line.py 2022-06-24 14:44:08 +0000
735@@ -428,12 +428,7 @@
736 return res
737
738 _columns = {
739- 'customer': fields.related(
740- 'order_id',
741- 'partner_id',
742- string='Customer',
743- readonly=True,
744- ),
745+ 'customer': fields.related('order_id', 'partner_id', string='Customer', readonly=True),
746 'po_cft': fields.selection(
747 _SELECTION_PO_CFT,
748 string="PO/CFT",
749@@ -605,6 +600,7 @@
750 size=64,
751 string='Product code',
752 store=False,
753+ write_relate=False,
754 ),
755 'product_name': fields.related(
756 'product_id',
757@@ -613,6 +609,7 @@
758 size=128,
759 string='Product description',
760 store=False,
761+ write_relate=False,
762 ),
763 }
764
765
766=== modified file 'bin/addons/stock/stock_move.py'
767--- bin/addons/stock/stock_move.py 2022-05-06 13:36:38 +0000
768+++ bin/addons/stock/stock_move.py 2022-06-24 14:44:08 +0000
769@@ -483,9 +483,9 @@
770 'price_unit': fields.float('Unit Price', digits_compute= dp.get_precision('Account'), help="Technical field used to record the product cost set by the user during a picking confirmation (when average price costing method is used)"),
771 'price_currency_id': fields.many2one('res.currency', 'Currency for average price', help="Technical field used to record the currency chosen by the user during a picking confirmation (when average price costing method is used)"),
772 'company_id': fields.many2one('res.company', 'Company', required=True, select=True),
773- 'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner", store=True, select=True),
774- 'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Order", select=True),
775- 'origin': fields.related('picking_id','origin',type='char', size=512, relation="stock.picking", string="Origin", store=True),
776+ 'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner", store=True, select=True, write_relate=False),
777+ 'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Order", select=True, write_relate=False),
778+ 'origin': fields.related('picking_id','origin',type='char', size=512, relation="stock.picking", string="Origin", store=True, write_relate=False),
779
780 # used for colors in tree views:
781 'scrapped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scrapped', readonly=True),
782@@ -519,7 +519,7 @@
783 ('unallocated', 'Unallocated'),
784 ('mixed', 'Mixed')], string='Allocated setup', method=True, store=False),
785 'purchase_line_id': fields.many2one('purchase.order.line', 'Purchase Order Line', ondelete='set null', select=True, readonly=True),
786- 'picking_subtype': fields.related('picking_id', 'subtype', string='Picking Subtype', type='selection', selection=[('picking', 'Picking'),('ppl', 'PPL'),('packing', 'Packing')],),
787+ 'picking_subtype': fields.related('picking_id', 'subtype', string='Picking Subtype', type='selection', selection=[('picking', 'Picking'),('ppl', 'PPL'),('packing', 'Packing')], write_relate=False),
788 'parent_doc_id': fields.function(_get_parent_doc, method=True, type='char', string='Picking', readonly=True),
789
790 'order_priority': fields.function(_get_order_information, method=True, string='Priority', type='selection',
791
792=== modified file 'bin/addons/stock_forecast/wizard/stock_forecast.py'
793--- bin/addons/stock_forecast/wizard/stock_forecast.py 2021-07-07 16:30:21 +0000
794+++ bin/addons/stock_forecast/wizard/stock_forecast.py 2022-06-24 14:44:08 +0000
795@@ -638,8 +638,9 @@
796 ('rfq_updated', 'Updated'),
797 #('rfq_done', 'RfQ Done'),
798 ]
799- _columns = {'order_state': fields.related('order_id', 'state', string='Purchase Order State', type='selection', selection=STATE_SELECTION,),
800- }
801+ _columns = {
802+ 'order_state': fields.related('order_id', 'state', string='Purchase Order State', type='selection', selection=STATE_SELECTION, write_relate=False),
803+ }
804
805 purchase_order_line()
806
807
808=== modified file 'bin/addons/stock_override/report/report_stock_move.py'
809--- bin/addons/stock_override/report/report_stock_move.py 2021-11-18 11:18:31 +0000
810+++ bin/addons/stock_override/report/report_stock_move.py 2022-06-24 14:44:08 +0000
811@@ -86,13 +86,13 @@
812 'comment': fields.char(size=128, string='Comment'),
813 'prodlot_id': fields.many2one('stock.production.lot', 'Batch', states={'done': [('readonly', True)]}, help="Batch number is used to put a serial number on the production", select=True),
814 'tracking_id': fields.many2one('stock.tracking', 'Pack', select=True, states={'done': [('readonly', True)]}, help="Logistical shipping unit: pallet, box, pack ..."),
815- 'origin': fields.related('picking_id', 'origin', type='char', size=512, relation="stock.picking", string="Origin", store=True),
816+ 'origin': fields.related('picking_id', 'origin', type='char', size=512, relation="stock.picking", string="Origin", store=True, write_relate=False),
817 'move': fields.many2one('stock.move', string='Move'),
818 'reason_type_id': fields.many2one('stock.reason.type', string='Reason type'),
819 'currency_id': fields.many2one('res.currency', string='Currency'),
820- 'product_code': fields.related('product_id', 'default_code', type='char', string='Product Code'),
821- 'product_name': fields.related('product_id', 'name', type='char', string='Product Name'),
822- 'expiry_date': fields.related('prodlot_id', 'life_date', type='date', string='Expiry Date'),
823+ 'product_code': fields.related('product_id', 'default_code', type='char', string='Product Code', write_relate=False),
824+ 'product_name': fields.related('product_id', 'name', type='char', string='Product Name', write_relate=False),
825+ 'expiry_date': fields.related('prodlot_id', 'life_date', type='date', string='Expiry Date', write_relate=False),
826 }
827
828 def init(self, cr):
829
830=== modified file 'bin/addons/stock_override/stock.py'
831--- bin/addons/stock_override/stock.py 2022-04-14 10:10:19 +0000
832+++ bin/addons/stock_override/stock.py 2022-06-24 14:44:08 +0000
833@@ -1130,9 +1130,9 @@
834 'dpo_line_id': fields.integer(string='Direct PO line', help='PO line from where this stock move is sourced (for sync. engine).'),
835 'from_dpo': fields.function(_get_from_dpo, fnct_search=_search_from_dpo, type='boolean', method=True, store=False, string='From DPO ?'),
836 'sync_dpo': fields.boolean(string='Sync. DPO'),
837- 'from_wkf_line': fields.related('picking_id', 'from_wkf', type='boolean', string='Internal use: from wkf'),
838+ 'from_wkf_line': fields.related('picking_id', 'from_wkf', type='boolean', string='Internal use: from wkf', write_relate=False),
839 'is_ext_cu': fields.related('picking_id', 'ext_cu', type='boolean', string='Ext. CU', write_relate=False),
840- 'fake_state': fields.related('state', type='char', store=False, string="Internal use"),
841+ 'fake_state': fields.related('state', type='char', store=False, string="Internal use", write_relate=False),
842 'processed_stock_move': fields.boolean(string='Processed Stock Move'),
843 'inactive_product': fields.function(_get_inactive_product, method=True, type='boolean', string='Product is inactive', store=False, multi='inactive'),
844 'inactive_error': fields.function(_get_inactive_product, method=True, type='char', string='Error', store=False, multi='inactive'),
845@@ -1142,7 +1142,7 @@
846 'expired_lot': fields.function(_is_expired_lot, method=True, type='boolean', string='Lot expired', store=False, multi='attribute'),
847 'product_tbd': fields.function(_is_expired_lot, method=True, type='boolean', string='TbD', store=False, multi='attribute'),
848 'has_to_be_resourced': fields.boolean(string='Has to be resourced'),
849- 'from_wkf': fields.related('picking_id', 'from_wkf', type='boolean', string='From wkf'),
850+ 'from_wkf': fields.related('picking_id', 'from_wkf', type='boolean', string='From wkf', write_relate=False),
851 'price_changed': fields.function(_is_price_changed, method=True, type='boolean', string='Price changed',
852 store={
853 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['price_unit', 'purchase_order_line'], 10),
854
855=== modified file 'bin/addons/stock_override/wizard/stock_card_wizard.py'
856--- bin/addons/stock_override/wizard/stock_card_wizard.py 2021-07-07 16:30:21 +0000
857+++ bin/addons/stock_override/wizard/stock_card_wizard.py 2022-06-24 14:44:08 +0000
858@@ -33,7 +33,7 @@
859 'product_id': fields.many2one('product.product', string='Product',
860 required=True),
861 'uom_id': fields.related('product_id', 'uom_id', type='many2one',
862- relation='product.uom', string='UoM'),
863+ relation='product.uom', string='UoM', write_relate=False),
864 'perishable': fields.boolean(string='Perishable'),
865 'prodlot_id': fields.many2one('stock.production.lot',
866 string='Batch number'),
867
868=== modified file 'bin/addons/supplier_catalogue/product.py'
869--- bin/addons/supplier_catalogue/product.py 2021-07-07 16:30:21 +0000
870+++ bin/addons/supplier_catalogue/product.py 2022-06-24 14:44:08 +0000
871@@ -211,8 +211,8 @@
872 help='The ordered quantity must be a multiple of this rounding value.', related_uom='uom_id'),
873 'min_order_qty': fields.float(digits=(16, 2), string='Min. Order Qty', related_uom='uom_id'),
874 'valid_from': fields.date(string='Valid from'),
875- 'partner_id': fields.related('suppinfo_id', 'name', string='Partner', type='many2one', relation='res.partner'),
876- 'product_id': fields.related('suppinfo_id', 'product_id', string='Product', type='many2one', relation='product.template'),
877+ 'partner_id': fields.related('suppinfo_id', 'name', string='Partner', type='many2one', relation='res.partner', write_relate=False),
878+ 'product_id': fields.related('suppinfo_id', 'product_id', string='Product', type='many2one', relation='product.template', write_relate=False),
879 'sequence': fields.function(_get_sequence, method=True, string='Sequence', type='integer',
880 store={'pricelist.partnerinfo': (lambda self, cr, uid, ids, c={}: ids, [], 20),
881 'product.supplierinfo': (_get_supplierinfo, ['sequence'], 20),
882
883=== modified file 'bin/addons/tender_flow/tender_flow.py'
884--- bin/addons/tender_flow/tender_flow.py 2022-03-21 12:41:58 +0000
885+++ bin/addons/tender_flow/tender_flow.py 2022-06-24 14:44:08 +0000
886@@ -136,7 +136,7 @@
887 'notes': fields.text('Notes'),
888 'internal_state': fields.selection([('draft', 'Draft'), ('updated', 'Rfq Updated'), ], string="Internal State", readonly=True),
889 'rfq_name_list': fields.function(_vals_get, method=True, string='RfQs Ref', type='char', readonly=True, store=False, multi='get_vals',),
890- 'product_id': fields.related('tender_line_ids', 'product_id', type='many2one', relation='product.product', string='Product'),
891+ 'product_id': fields.related('tender_line_ids', 'product_id', type='many2one', relation='product.product', string='Product', write_relate=False),
892 'delivery_address': fields.many2one('res.partner.address', string='Delivery address', required=True),
893 'tender_from_fo': fields.function(_is_tender_from_fo, method=True, type='boolean', string='Is tender from FO ?',),
894 '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),
895@@ -960,7 +960,7 @@
896 'purchase_order_line_id': fields.many2one('purchase.order.line', string="Related RfQ line", readonly=True),
897 'sale_order_line_id': fields.many2one('sale.order.line', string="Sale Order Line"),
898 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
899- 'date_planned': fields.related('tender_id', 'requested_date', type='date', string='Requested Date', store=False,),
900+ 'date_planned': fields.related('tender_id', 'requested_date', type='date', string='Requested Date', store=False, write_relate=False),
901 # functions
902 'supplier_id': fields.related('purchase_order_line_id', 'order_id', 'partner_id', type='many2one', relation='res.partner', string="Supplier", readonly=True),
903 'price_unit': fields.related('purchase_order_line_id', 'price_unit', type="float", string="Price unit", digits_compute=dp.get_precision('Purchase Price Computation'), readonly=True), # same precision as related field!
904@@ -969,7 +969,7 @@
905 'currency_id': fields.function(_get_total_price, method=True, type='many2one', relation='res.currency', string='Cur.', multi='total'),
906 'purchase_order_id': fields.related('purchase_order_line_id', 'order_id', type='many2one', relation='purchase.order', string="Related RfQ", readonly=True,),
907 'purchase_order_line_number': fields.related('purchase_order_line_id', 'line_number', type="char", string="Related Line Number", readonly=True,),
908- 'state': fields.related('tender_id', 'state', type="selection", selection=_SELECTION_TENDER_STATE, string="State",),
909+ 'state': fields.related('tender_id', 'state', type="selection", selection=_SELECTION_TENDER_STATE, string="State", write_relate=False),
910 'line_state': fields.selection([('draft', 'Draft'), ('cancel', 'Cancelled'), ('cancel_r', 'Cancelled-r'), ('done', 'Done')], string='State', readonly=True),
911 'comment': fields.char(size=128, string='Comment'),
912 'has_to_be_resourced': fields.boolean(string='Has to be resourced'),
913@@ -1663,9 +1663,9 @@
914
915 return res
916
917- _columns = {'tender_id': fields.related('order_id', 'tender_id', type='many2one', relation='tender', string='Tender',),
918+ _columns = {'tender_id': fields.related('order_id', 'tender_id', type='many2one', relation='tender', string='Tender', write_relate=False),
919 'tender_line_id': fields.many2one('tender.line', string='Tender Line'),
920- 'rfq_ok': fields.related('order_id', 'rfq_ok', type='boolean', string='RfQ ?'),
921+ 'rfq_ok': fields.related('order_id', 'rfq_ok', type='boolean', string='RfQ ?', write_relate=False),
922 'sale_order_line_id': fields.many2one('sale.order.line', string='FO line', readonly=True),
923 'rfq_line_state_to_display': fields.function(_get_rfq_line_state_to_display, string='State',
924 type='selection', selection=RFQ_LINE_STATE_DISPLAY_SELECTION,
925@@ -1960,6 +1960,7 @@
926 string='Tender',
927 type='many2one',
928 relation='tender',
929+ write_relate=False,
930 ),
931 }
932
933
934=== modified file 'bin/osv/fields.py'
935--- bin/osv/fields.py 2022-05-20 08:27:44 +0000
936+++ bin/osv/fields.py 2022-06-24 14:44:08 +0000
937@@ -1020,11 +1020,18 @@
938 def __init__(self, *arg, **args):
939 self.arg = arg
940 self._relations = []
941- write_fnct = self._fnct_write
942- if not args.get('write_relate', True):
943- write_fnct = None
944+ write_fnct = None
945+ if args.get('write_relate', False):
946+ write_fnct = self._fnct_write
947
948 super(related, self).__init__(self._fnct_read, arg, write_fnct, fnct_inv_arg=arg, method=True, fnct_search=self._fnct_search, **args)
949+
950+ if not write_fnct and args.get('store'):
951+ # example on account.move, partner_id fields.related store=True
952+ # is set as hidden in form view
953+ # without this the value s not cleaned by the web, and empty partner_id is written as '' instead of False
954+ self.readonly = args.get('readonly')
955+
956 if self.store is True:
957 # TODO: improve here to change self.store = {...} according to related objects
958 pass

Subscribers

People subscribed via source and target branches