diff options
| author | Arnold Moyaux <arm@odoo.com> | 2020-01-15 15:56:36 +0000 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2020-03-05 14:31:13 +0000 |
| commit | 7eb22cef2f0c75c8a7f20ac26e5d47348e5ca6ef (patch) | |
| tree | 96cb979ce1027546c875f67914034c653ac5a455 /addons/purchase_requisition_stock | |
| parent | 6f247d799a5e15ca0e6d3ea77f3cb378b1c92e8a (diff) | |
[IMP] purchase_requisition: remove useless inherit
_prepapre_tender_values in only call from purchase_requisition_stock.
It's not needed to have 2 functions, everything should be in
purchase_requisition_stock.
Diffstat (limited to 'addons/purchase_requisition_stock')
| -rw-r--r-- | addons/purchase_requisition_stock/models/purchase_requisition.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/addons/purchase_requisition_stock/models/purchase_requisition.py b/addons/purchase_requisition_stock/models/purchase_requisition.py index 3614b16fb7d..d490edace07 100644 --- a/addons/purchase_requisition_stock/models/purchase_requisition.py +++ b/addons/purchase_requisition_stock/models/purchase_requisition.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, fields, models, _ +from odoo import fields, models class PurchaseRequisition(models.Model): @@ -21,9 +21,19 @@ class PurchaseRequisition(models.Model): picking_type_id = fields.Many2one('stock.picking.type', 'Operation Type', required=True, default=_get_picking_in, domain="['|',('warehouse_id', '=', False), ('warehouse_id.company_id', '=', company_id)]") def _prepare_tender_values(self, product_id, product_qty, product_uom, location_id, name, origin, company_id, values): - res = super(PurchaseRequisition, self)._prepare_tender_values(product_id, product_qty, product_uom, location_id, name, origin, company_id, values) - res['line_ids'][0][2]['move_dest_id'] = values.get('move_dest_ids') and values['move_dest_ids'][0].id or False - return res + return { + 'origin': origin, + 'date_end': values['date_planned'], + 'user_id': False, + 'warehouse_id': values.get('warehouse_id') and values['warehouse_id'].id or False, + 'company_id': company_id.id, + 'line_ids': [(0, 0, { + 'product_id': product_id.id, + 'product_uom_id': product_uom.id, + 'product_qty': product_qty, + 'move_dest_id': values.get('move_dest_ids') and values['move_dest_ids'][0].id or False + })], + } class PurchaseRequisitionLine(models.Model): |
