File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
purchase_specific_location/models Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 11from . import stock_orderpoint
22from . import stock_rule
33from . import purchase_order
4+ from . import procurement_group
Original file line number Diff line number Diff line change 1+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+ from odoo import api , models
4+
5+
6+ class ProcurementGroup (models .Model ):
7+ _inherit = "procurement.group"
8+
9+ @api .model
10+ def run (self , procurements , raise_user_error = True ):
11+ new_procurements = []
12+ for procurement in procurements :
13+ orderpoint = procurement .values .get ("orderpoint_id" )
14+ if (
15+ self .env .context .get ("from_orderpoint" )
16+ and orderpoint .location_destination_id
17+ and orderpoint .location_id == procurement .location_id
18+ ):
19+ new_procurements .append (
20+ procurement ._replace (location_id = orderpoint .location_destination_id )
21+ )
22+ else :
23+ new_procurements .append (procurement )
24+ return super ().run (new_procurements , raise_user_error = raise_user_error )
You can’t perform that action at this time.
0 commit comments