minor fix

This commit is contained in:
wilson gomez 2022-02-04 10:34:02 -05:00
parent 2f8cb36176
commit a3deb9969a
1 changed files with 6 additions and 2 deletions

View File

@ -43,6 +43,7 @@ class Sale(metaclass=PoolMeta):
@classmethod
def create(cls, records):
print('records', records)
sales = super(Sale, cls).create(records)
for sale in sales:
string_ = ''
@ -170,6 +171,7 @@ class SaleForChannel(Wizard):
print_ = StateReport('sale_web_channel.sale_for_channel_report')
def do_print_(self, action):
report_context = {
'company': self.start.company.id,
'company_name': self.start.company.rec_name,
@ -179,6 +181,7 @@ class SaleForChannel(Wizard):
'start_date': self.start.start_date,
'end_date': self.start.end_date,
'include_canceled': self.start.include_canceled,
}
report_context['channels'] = [{'id': c.id, 'name': c.rec_name} for c in self.start.channels]
return action, report_context
@ -192,8 +195,8 @@ class SaleForChannelReport(Report):
__name__ = 'sale_web_channel.sale_for_channel_report'
@classmethod
def get_context(cls, records, data):
report_context = super(SaleForChannelReport, cls).get_context(records, data)
def get_context(cls, records, header, data):
report_context = super().get_context(records, header, data)
pool = Pool()
Sale = pool.get('sale.sale')
channel_ids = [c['id'] for c in data['channels']]
@ -206,6 +209,7 @@ class SaleForChannelReport(Report):
('shop', '=', shop_id),
('sale_date', '>=', data['start_date']),
('sale_date', '<=', data['end_date']),
]
states_sale = ['processing', 'done']
if data['include_canceled']: