minor fix

This commit is contained in:
wilson gomez 2022-02-02 17:23:52 -05:00
parent 0cdedd4c9a
commit aa8e8887b4
3 changed files with 11 additions and 1 deletions

View File

@ -10,7 +10,7 @@ class Invoice(metaclass=PoolMeta):
__name__ = 'account.invoice'
shop = fields.Many2One('sale.shop', 'Shop', required=False, domain=[
('id', 'in', Eval('context', {}).get('shops', [])),
], depends=['number'])
], depends=['number'], states={'invisible': Eval('type') != 'out'})
class InvoicesStart(metaclass=PoolMeta):

10
sale.py
View File

@ -717,6 +717,16 @@ class SaleShopDetailedReport(Report):
('product', '=', data['product'])
)
config = pool.get('sale.configuration')(1)
products_exception = []
if hasattr(config, 'tip_product') and config.tip_product and config.exclude_tip_and_delivery:
products_exception.append(config.tip_product.id)
if hasattr(config, 'delivery_product') and config.delivery_product and config.exclude_tip_and_delivery:
products_exception.append(config.delivery_product.id)
if len(products_exception) > 0:
invoice_line_dom.append(('product', 'not in', products_exception))
start_lines = InvoiceLine.search(
invoice_line_dom, order=[('invoice.invoice_date', 'ASC')]
)

Binary file not shown.