add app_stock_barcode

This commit is contained in:
ivan deng
2018-03-20 02:40:48 +08:00
parent cbf28973a5
commit b4fe1744be
18 changed files with 537 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
from odoo import fields, models, api, _
import odoo.addons.decimal_precision as dp
from odoo.exceptions import UserError
from odoo.exceptions import Warning
import logging
logger = logging.getLogger(__name__)
class PackOperation(models.Model):
_inherit = "stock.pack.operation"
weight = fields.Float(
'Weight', digits=dp.get_precision('Stock Weight'), related='product_id.weight', readonly=True, store=True,
help="The weight of the contents in Kg, not including any packaging, etc.")
weight_done_subtotal = fields.Float(
'Weight Done Subtotal', digits=dp.get_precision('Stock Weight'), compute='_compute_weight_done_subtotal', readonly=True, store=True,
help="The weight of the contents in Kg, not including any packaging, etc.")
@api.depends('weight', 'qty_done')
def _compute_weight_done_subtotal(self):
for rec in self:
rec.weight_done_subtotal = rec.weight * rec.qty_done