mirror of
https://bitbucket.org/presik/trytonpsk-sale_pos.git
synced 2023-12-14 07:13:02 +01:00
Remove lines commented
This commit is contained in:
parent
00fded9576
commit
a99d625c49
1 changed files with 0 additions and 130 deletions
130
sale.py
130
sale.py
|
@ -1156,136 +1156,6 @@ class SaleDetailedReport(Report):
|
|||
return report_context
|
||||
|
||||
|
||||
# class SalePaymentForm(ModelView):
|
||||
# 'Sale Payment Form'
|
||||
# __name__ = 'sale.payment.form'
|
||||
# journal = fields.Many2One('account.statement.journal', 'Statement Journal',
|
||||
# domain=[
|
||||
# ('id', 'in', Eval('journals', [])),
|
||||
# ], depends=['journals'], required=True)
|
||||
# journals = fields.One2Many('account.statement.journal', None,
|
||||
# 'Allowed Statement Journals')
|
||||
# payment_amount = fields.Numeric('Payment amount', required=True,
|
||||
# digits=(16, Eval('currency_digits', 2)),
|
||||
# depends=['currency_digits'])
|
||||
# currency_digits = fields.Integer('Currency Digits')
|
||||
# party = fields.Many2One('party.party', 'Party', readonly=True)
|
||||
# require_voucher = fields.Boolean('Require Voucher',
|
||||
# depends=['journal'])
|
||||
# voucher = fields.Char('Voucher Number', states={
|
||||
# 'required': Eval('require_voucher', False),
|
||||
# 'invisible': Not(Eval('require_voucher', False)),
|
||||
# }, depends=['require_voucher'])
|
||||
# self_pick_up = fields.Boolean('Self Pick Up', readonly=True)
|
||||
# do_invoice = fields.Boolean('Do Invoice')
|
||||
#
|
||||
# @fields.depends('journal', 'voucher')
|
||||
# def on_change_with_require_voucher(self):
|
||||
# if self.journal:
|
||||
# return self.journal.require_voucher
|
||||
# else:
|
||||
# return False
|
||||
#
|
||||
# @classmethod
|
||||
# def default_require_voucher(cls):
|
||||
# return False
|
||||
#
|
||||
# @classmethod
|
||||
# def default_do_invoice(cls):
|
||||
# return True
|
||||
#
|
||||
#
|
||||
# class WizardSalePayment(Wizard):
|
||||
# 'Wizard Sale Payment'
|
||||
# __name__ = 'sale.payment'
|
||||
# start = StateView('sale.payment.form',
|
||||
# 'sale_pos.sale_payment_view_form', [
|
||||
# Button('Cancel', 'end', 'tryton-cancel'),
|
||||
# Button('Pay', 'pay_', 'tryton-ok', default=True),
|
||||
# ])
|
||||
# pay_ = StateTransition()
|
||||
#
|
||||
# @classmethod
|
||||
# def __setup__(cls):
|
||||
# super(WizardSalePayment, cls).__setup__()
|
||||
#
|
||||
# def default_start(self, fields):
|
||||
# pool = Pool()
|
||||
# Sale = pool.get('sale.sale')
|
||||
# User = pool.get('res.user')
|
||||
# sale = Sale(Transaction().context['active_id'])
|
||||
# user = User(Transaction().user)
|
||||
# sale_device = sale.sale_device or user.sale_device or False
|
||||
# if user.id != 0 and not sale_device:
|
||||
# raise SaleDeviceError(gettext('sale_pos.msg_not_sale_device'))
|
||||
# return {
|
||||
# 'journal': sale_device.journal.id
|
||||
# if sale_device.journal else None,
|
||||
# 'journals': [j.id for j in sale_device.journals],
|
||||
# 'payment_amount': abs(sale.total_amount - sale.paid_amount
|
||||
# if sale.paid_amount else sale.total_amount),
|
||||
# 'currency_digits': sale.currency_digits,
|
||||
# 'party': sale.party.id,
|
||||
# }
|
||||
#
|
||||
# def transition_pay_(self):
|
||||
# pool = Pool()
|
||||
# User = pool.get('res.user')
|
||||
# user = User(Transaction().user)
|
||||
# Sale = pool.get('sale.sale')
|
||||
# Statement = pool.get('account.statement')
|
||||
# StatementLine = pool.get('account.statement.line')
|
||||
# active_id = Transaction().context.get('active_id', False)
|
||||
# sale = Sale(active_id)
|
||||
#
|
||||
# form = self.start
|
||||
# if form.payment_amount > 0:
|
||||
# device_id = user.sale_device.id if user.sale_device else sale.sale_device.id
|
||||
# statements = Statement.search([
|
||||
# ('journal', '=', form.journal.id),
|
||||
# ('state', '=', 'draft'),
|
||||
# ('sale_device', '=', device_id),
|
||||
# ], order=[('date', 'DESC')])
|
||||
# if not statements:
|
||||
# raise DraftStatementError(
|
||||
# gettext('sale_pos.msg_not_draft_statement', journal=form.journal.name))
|
||||
#
|
||||
# if not sale.number:
|
||||
# Sale.set_number([sale])
|
||||
#
|
||||
# if not sale.party.account_receivable:
|
||||
# raise PartyMissingAccount(
|
||||
# gettext('sale_pos.msg_party_without_account_receivable', s=sale.party.name))
|
||||
# account = sale.party.account_receivable.id
|
||||
#
|
||||
# if form.payment_amount:
|
||||
# amount = form.payment_amount
|
||||
# if sale.total_amount < 0:
|
||||
# amount = amount * -1
|
||||
# payment = StatementLine(
|
||||
# statement=statements[0].id,
|
||||
# date=date.today(),
|
||||
# amount=amount,
|
||||
# party=sale.party.id,
|
||||
# account=account,
|
||||
# description=self.start.voucher,
|
||||
# sale=active_id,
|
||||
# # number=self.start.voucher,
|
||||
# # voucher=self.start.voucher,
|
||||
# )
|
||||
# payment.save()
|
||||
#
|
||||
# if sale.total_amount != sale.paid_amount:
|
||||
# return 'start'
|
||||
# sale.save()
|
||||
# if self.start.do_invoice:
|
||||
# # for inv in sale.invoices:
|
||||
# # if inv.state == 'posted':
|
||||
# # inv.write([inv], {'state': 'draft'})
|
||||
# Sale.workflow_to_end([sale])
|
||||
# return 'end'
|
||||
|
||||
|
||||
class SaleIncomeDailyStart(ModelView):
|
||||
'Sale Income Daily Start'
|
||||
__name__ = 'sale_pos.sale_income_daily.start'
|
||||
|
|
Loading…
Reference in a new issue