fix report shop daily summary

add field email template
This commit is contained in:
Wilson Gomez 2023-04-19 12:10:42 -05:00
parent 4fab20f229
commit 771504c144
2 changed files with 8 additions and 4 deletions

10
shop.py
View File

@ -49,6 +49,7 @@ class SaleShop(metaclass=PoolMeta):
('company', '=', Eval('company')),
])
freight_product = fields.Many2One('product.product', 'Freight Product')
email_template = fields.Many2One('email.template', 'Template')
class ShopDailySummaryStart(ModelView):
@ -104,6 +105,7 @@ class ShopDailySummaryReport(Report):
Sale = pool.get('sale.sale')
Line = pool.get('sale.line')
Invoice = pool.get('account.invoice')
Company = pool.get('company.company')
fixed_hour = time(6, 0)
cursor = Transaction().connection.cursor()
@ -129,10 +131,10 @@ class ShopDailySummaryReport(Report):
_end_date = datetime.combine(end_date, fixed_hour)
_end_date = Company.convert_timezone(_end_date, True)
where_ &= sale_date >= data['sale_date']
where_ &= sale_date <= end_date
where_ &= create_date >= _start_date
where_ &= create_date <= _end_date
where_ &= sale.sale_date >= data['sale_date']
where_ &= sale.sale_date <= end_date
where_ &= sale.create_date >= _start_date
where_ &= sale.create_date <= _end_date
columns_ = [sale.id, Sum(line.unit_price*line.quantity).as_('amount')]
query = line.join(sale, condition=line.sale==sale.id).select(*columns_,

View File

@ -26,5 +26,7 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
<field name="credit_note_electronic_authorization"/>
<label name="debit_note_electronic_authorization"/>
<field name="debit_note_electronic_authorization"/>
<label name="email_template"/>
<field name="email_template"/>
</xpath>
</data>