minor fix
This commit is contained in:
parent
2f8cb36176
commit
a3deb9969a
8
sale.py
8
sale.py
|
@ -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']:
|
||||
|
|
Loading…
Reference in New Issue