mirror of
https://bitbucket.org/presik/trytonpsk-sale_pos.git
synced 2023-12-14 07:13:02 +01:00
add filter for user in income daily report
This commit is contained in:
parent
08572c66e8
commit
d31579970c
2 changed files with 15 additions and 5 deletions
16
sale.py
16
sale.py
|
@ -1378,7 +1378,7 @@ class SaleIncomeDailyStart(ModelView):
|
|||
company = fields.Many2One('company.company', 'Company', required=True)
|
||||
date = fields.Date('Date', required=True)
|
||||
shop = fields.Many2One('sale.shop', 'Shop')
|
||||
# user = fields.Many2One('res.user', 'User', required=True)
|
||||
user = fields.Many2One('res.user', 'User')
|
||||
# journal = fields.Many2One('account.statement.journal', 'Journal')
|
||||
|
||||
@staticmethod
|
||||
|
@ -1389,6 +1389,10 @@ class SaleIncomeDailyStart(ModelView):
|
|||
def default_shop():
|
||||
return Transaction().context.get('shop')
|
||||
|
||||
@staticmethod
|
||||
def default_user():
|
||||
return Transaction().user
|
||||
|
||||
@staticmethod
|
||||
def default_date():
|
||||
Date = Pool().get('ir.date')
|
||||
|
@ -1406,13 +1410,15 @@ class SaleIncomeDaily(Wizard):
|
|||
print_ = StateReport('sale_pos.sale_income_daily_report')
|
||||
|
||||
def do_print_(self, action):
|
||||
shop_id = None
|
||||
shop_id, user_id = None, None
|
||||
if self.start.user:
|
||||
user_id = self.start.user.id
|
||||
if self.start.shop:
|
||||
shop_id = self.start.shop.id
|
||||
report_context = {
|
||||
'company': self.start.company.id,
|
||||
'date': self.start.date,
|
||||
# 'user': self.start.user.id,
|
||||
'user': user_id,
|
||||
'shop': shop_id,
|
||||
}
|
||||
return action, report_context
|
||||
|
@ -1511,6 +1517,10 @@ class SaleIncomeDailyReport(Report):
|
|||
('move', '!=', None),
|
||||
('move.post_date', '=', data['date']),
|
||||
]
|
||||
if data['user']:
|
||||
dom_vouchers.append(
|
||||
('create_uid', '=', data['user']),
|
||||
)
|
||||
# if voucher_ids:
|
||||
# dom_vouchers.append(
|
||||
# ('id', 'not in', voucher_ids)
|
||||
|
|
|
@ -8,6 +8,6 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="date"/>
|
||||
<label name="shop"/>
|
||||
<field name="shop" widget="selection"/>
|
||||
<!-- <label name="user"/>
|
||||
<field name="user" widget="selection"/> -->
|
||||
<label name="user"/>
|
||||
<field name="user" widget="selection"/>
|
||||
</form>
|
||||
|
|
Loading…
Reference in a new issue