al confirmar una orden, asigna el warehouse al correspondiente al nodo del usuario
This commit is contained in:
parent
808e60729f
commit
5d4cbd476f
3 changed files with 9 additions and 2 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
#import logging
|
#import logging
|
||||||
|
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.exceptions import ValidationError, Warning
|
#from odoo.exceptions import ValidationError, Warning
|
||||||
|
|
||||||
#_logger = logging.getLogger(__name__)
|
#_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#import logging
|
#import logging
|
||||||
|
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
from odoo.exceptions import ValidationError, Warning
|
#from odoo.exceptions import ValidationError, Warning
|
||||||
|
|
||||||
#_logger = logging.getLogger(__name__)
|
#_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import random
|
import random
|
||||||
|
|
||||||
from odoo import models, api, fields
|
from odoo import models, api, fields
|
||||||
|
from odoo.exceptions import ValidationError, Warning
|
||||||
|
|
||||||
|
|
||||||
class SaleOrder(models.Model):
|
class SaleOrder(models.Model):
|
||||||
|
|
@ -14,3 +15,9 @@ class SaleOrder(models.Model):
|
||||||
)
|
)
|
||||||
is_cp = fields.Boolean(string="Is part of a Collective Purchase")
|
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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue