Browse Source

to remove - oca dependencies

pull/449/head
Jordi Ballester Alomar 5 years ago
committed by Adrià Gil Sorribes
parent
commit
f40b87bc39
  1. 1
      oca_dependencies.txt
  2. 14
      pos_statement_closing_balance/models/pos_session.py
  3. 10
      pos_statement_closing_balance/wizards/pos_update_statement_closing_balance.py

1
oca_dependencies.txt

@ -1,3 +1,4 @@
queue
partner-contact
stock-logistics-barcode
pos https://github.com/ForgeFlow/pos.git 12.0-pos_bank_closing_balance

14
pos_statement_closing_balance/models/pos_session.py

@ -7,20 +7,6 @@ from odoo.exceptions import ValidationError
class PosSession(models.Model):
_inherit = "pos.session"
ending_balances_to_update = fields.Boolean(
compute='_compute_ending_balances_to_update')
@api.multi
def _compute_ending_balances_to_update(self):
for rec in self:
rec.ending_balances_to_update = False
for statement in rec.statement_ids:
journal = statement.journal_id
if journal.pos_control_ending_balance and \
journal.type != 'cash' or (journal.type == 'cash' and
not rec.cash_control):
rec.ending_balances_to_update = True
@api.multi
def button_update_statement_ending_balance(self):
self.ensure_one()

10
pos_statement_closing_balance/wizards/pos_update_statement_closing_balance.py

@ -45,11 +45,9 @@ class POSBankStatementUpdateClosingBalance(models.TransientModel):
raise UserError(_('You cannot start the closing '
'balance for multiple POS sessions'))
session = session_obj.browse(active_ids[0])
for statement in session.statement_ids:
if statement.journal_id.type != 'cash' or \
(statement.journal_id.type == 'cash' and
not session.cash_control):
items.append([0, 0, self._prepare_item(session, statement)])
for statement in session.statement_ids.filtered(
lambda s: s.journal_id.pos_control_ending_balance):
items.append([0, 0, self._prepare_item(session, statement)])
res["session_id"] = session.id
res["item_ids"] = items
return res
@ -79,7 +77,7 @@ class POSBankStatementUpdateClosingBalance(models.TransientModel):
).create(self._prepare_cash_box_journal(item))
)
wizard.run()
item.statement_id.balance_end_real = item.balance_end_real
item.statement_id.balance_end_real = item.balance_end_real
return True

Loading…
Cancel
Save