diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-01-09 13:37:37 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-01-09 13:37:37 +0700 |
| commit | 8be31f0f44c2fde870c7c85e27379f88e1b38d7c (patch) | |
| tree | 7114c0c40e24812ad0bed10e8f79d74bf1e0130c | |
| parent | 6f62411bf3965fc27e24d8c997cc2bca771a0b8e (diff) | |
delete function create_reklas_penjualan
| -rw-r--r-- | indoteknik_custom/models/invoice_reklas.py | 49 | ||||
| -rw-r--r-- | indoteknik_custom/models/invoice_reklas_penjualan.py | 1 |
2 files changed, 1 insertions, 49 deletions
diff --git a/indoteknik_custom/models/invoice_reklas.py b/indoteknik_custom/models/invoice_reklas.py index b1ba49e8..30da02d1 100644 --- a/indoteknik_custom/models/invoice_reklas.py +++ b/indoteknik_custom/models/invoice_reklas.py @@ -94,51 +94,4 @@ class InvoiceReklas(models.TransientModel): 'type': 'ir.actions.act_window', 'res_id': account_move.id } - - - def create_reklas_penjualan(self): - if not self.pay_amt: - raise UserError('Yang dibayarkan harus diisi') - - account_ids = self._context['account_ids'] - invoices = self.env['account.move'].browse(account_ids) - current_time = datetime.now() - for invoice in invoices: - ref_name = 'REKLAS '+invoice.reklas_id.name+" UANG MUKA PENJUALAN "+invoice.name+" "+invoice.partner_id.name - parameters_header = { - 'ref': ref_name, - 'date': current_time, - 'journal_id': 13 - } - - account_move = request.env['account.move'].create([parameters_header]) - _logger.info('Success Reklas with %s' % account_move.name) - - parameter_debit = { - 'move_id': account_move.id, - 'account_id': 449, # uang muka penjualan - 'partner_id': invoice.partner_id.id, - 'currency_id': 12, - 'debit': self.pay_amt, - 'credit': 0, - 'name': ref_name - } - parameter_credit = { - 'move_id': account_move.id, - 'account_id': 395, - 'partner_id': invoice.partner_id.id, - 'currency_id': 12, - 'debit': 0, - 'credit': self.pay_amt, - 'name': ref_name - } - request.env['account.move.line'].create([parameter_debit, parameter_credit]) - return { - 'name': _('Journal Entries'), - 'view_mode': 'form', - 'res_model': 'account.move', - 'target': 'current', - 'view_id': False, - 'type': 'ir.actions.act_window', - 'res_id': account_move.id - } +
\ No newline at end of file diff --git a/indoteknik_custom/models/invoice_reklas_penjualan.py b/indoteknik_custom/models/invoice_reklas_penjualan.py index 533270d2..5027c8af 100644 --- a/indoteknik_custom/models/invoice_reklas_penjualan.py +++ b/indoteknik_custom/models/invoice_reklas_penjualan.py @@ -16,7 +16,6 @@ class InvoiceReklasPenjualan(models.TransientModel): invoice_reklas_line = fields.One2many('invoice.reklas.penjualan.line', 'invoice_reklas_id', string='Invoice Reklas Line') def create_reklas_penjualan(self): - # invoices = self.invoice_reklas_line.mapped('invoice_id') invoices = self.invoice_reklas_line current_time = datetime.now() |
