mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-26 21:32:03 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1,5 @@
|
|||
# Copyright (C) 2019 Sunflower IT <sunflowerweb.nl>
|
||||
# License GNU Affero General Public License <http://www.gnu.org/licenses/>.
|
||||
|
||||
from . import stock_picking
|
||||
from . import sale_order
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
# Copyright (C) 2019 Sunflower IT <sunflowerweb.nl>
|
||||
# License GNU Affero General Public License <http://www.gnu.org/licenses/>.
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
_inherit = "sale.order"
|
||||
|
||||
def action_confirm(self):
|
||||
res = super().action_confirm()
|
||||
for order in self:
|
||||
order.picking_ids.write({"brand_id": order.brand_id.id})
|
||||
return res
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# Copyright (C) 2019 Sunflower IT <sunflowerweb.nl>
|
||||
# License GNU Affero General Public License <http://www.gnu.org/licenses/>.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_name = "stock.picking"
|
||||
_inherit = ["stock.picking", "res.brand.mixin"]
|
||||
|
||||
brand_id = fields.Many2one(
|
||||
help="Brand to use for this picking.",
|
||||
)
|
||||
|
||||
def _is_brand_required(self):
|
||||
self.ensure_one()
|
||||
if self.picking_type_id.code in ("internal", "mrp_operation"):
|
||||
return False
|
||||
return super()._is_brand_required()
|
||||
Loading…
Add table
Add a link
Reference in a new issue