Add product_barcode in SO lines, PO lines, stock move lines and invoice lines with optional="hide"

Show warning about double VAT partner even when not in editable mode
This commit is contained in:
Alexis de Lattre
2021-04-28 11:27:04 +02:00
parent cfb58ed80f
commit 96bfda6e1b
10 changed files with 52 additions and 12 deletions

View File

@@ -2,7 +2,7 @@
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, _
from odoo import fields, models, _
from odoo.exceptions import UserError
import logging
@@ -12,6 +12,9 @@ logger = logging.getLogger(__name__)
class StockMove(models.Model):
_inherit = 'stock.move'
# for optional display in tree view
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
# def name_get(self):
# '''name_get of stock_move is important for the reservation of the
# quants: so want to add the name of the customer and the expected date
@@ -49,6 +52,9 @@ class StockMove(models.Model):
class StockMoveLine(models.Model):
_inherit = 'stock.move.line'
# for optional display in tree view
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
# TODO: I think it's not complete
def button_do_unreserve(self):
for moveline in self: