diff --git a/purchase_collective/models/partner_network.py b/purchase_collective/models/partner_network.py index 0fa7f7a..8292d68 100644 --- a/purchase_collective/models/partner_network.py +++ b/purchase_collective/models/partner_network.py @@ -5,7 +5,7 @@ #import logging from odoo import models, fields, api -from odoo.exceptions import ValidationError, Warning +#from odoo.exceptions import ValidationError, Warning #_logger = logging.getLogger(__name__) diff --git a/purchase_collective/models/partner_node.py b/purchase_collective/models/partner_node.py index 2988213..3c0e762 100644 --- a/purchase_collective/models/partner_node.py +++ b/purchase_collective/models/partner_node.py @@ -5,7 +5,7 @@ #import logging from odoo import models, fields, api -from odoo.exceptions import ValidationError, Warning +#from odoo.exceptions import ValidationError, Warning #_logger = logging.getLogger(__name__) diff --git a/purchase_collective/models/sale_order.py b/purchase_collective/models/sale_order.py index 3a86f21..d7c3078 100644 --- a/purchase_collective/models/sale_order.py +++ b/purchase_collective/models/sale_order.py @@ -1,6 +1,7 @@ import random from odoo import models, api, fields +from odoo.exceptions import ValidationError, Warning class SaleOrder(models.Model): @@ -14,3 +15,9 @@ class SaleOrder(models.Model): ) is_cp = fields.Boolean(string="Is part of a Collective Purchase") + @api.multi + def action_confirm(self): + for order in self: + order.warehouse_id = order.partner_id.node_id.wh_id + + return super(SaleOrder, self).action_confirm()