diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-06 10:44:49 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-06 10:44:49 +0700 |
| commit | 12b015dc599f3a3876b10171bcec95e8aba7683c (patch) | |
| tree | c4f6b9b3510dca21a72d9454f7fcd4335347d5f9 | |
| parent | 7f9971a4c838b84fb1223845ccdb8256eb08b72d (diff) | |
| parent | c6c1e26d35327b61a88b247ef94cfff9257b492a (diff) | |
Merge branch 'production' into change/feature/pricelist
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 12 | ||||
| -rw-r--r-- | indoteknik_custom/models/product_pricelist.py | 3 | ||||
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 8 | ||||
| -rw-r--r-- | indoteknik_custom/models/solr/apache_solr_queue.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/views/account_move.xml | 6 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 2 |
6 files changed, 26 insertions, 7 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 18025b32..c3cd7ef9 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -2,6 +2,10 @@ from odoo import models, api, fields from odoo.exceptions import AccessError, UserError, ValidationError from datetime import timedelta, date import logging +import base64 +import PyPDF2 +import os +import re _logger = logging.getLogger(__name__) @@ -23,6 +27,14 @@ class AccountMove(models.Model): cost_centre_id = fields.Many2one('cost.centre', string='Cost Centre') analytic_account_ids = fields.Many2many('account.analytic.account', string='Analytic Account') due_line = fields.One2many('due.extension.line', 'invoice_id', compute='_compute_due_line', string='Due Extension Lines') + no_faktur_pajak = fields.Char(string='No Faktur Pajak') + + @api.onchange('efaktur_id') + def change_efaktur_id(self): + for invoice in self: + if not invoice.efaktur_id: + return + invoice.no_faktur_pajak = invoice.efaktur_id.name def _compute_due_line(self): for invoice in self: diff --git a/indoteknik_custom/models/product_pricelist.py b/indoteknik_custom/models/product_pricelist.py index 384d1353..b7a6d77e 100644 --- a/indoteknik_custom/models/product_pricelist.py +++ b/indoteknik_custom/models/product_pricelist.py @@ -45,5 +45,4 @@ class ProductPricelistItem(models.Model): _inherit = 'product.pricelist.item' manufacture_id = fields.Many2one('x_manufactures', string='Manufacture') - -
\ No newline at end of file + computed_price = fields.Float(string='Computed Price')
\ No newline at end of file diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 728c0bba..9324930e 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -392,9 +392,11 @@ class SaleOrder(models.Model): def _set_sppkp_npwp_contact(self): partner = self.partner_id.parent_id or self.partner_id - partner.customer_type = self.customer_type - partner.npwp = self.npwp - partner.sppkp = self.sppkp + if not partner.sppkp or not partner.npwp or not partner.email or partner.customer_type: + partner.customer_type = self.customer_type + partner.npwp = self.npwp + partner.sppkp = self.sppkp + partner.email = self.email def _compute_total_margin(self): for order in self: diff --git a/indoteknik_custom/models/solr/apache_solr_queue.py b/indoteknik_custom/models/solr/apache_solr_queue.py index f66d356d..8dd7c273 100644 --- a/indoteknik_custom/models/solr/apache_solr_queue.py +++ b/indoteknik_custom/models/solr/apache_solr_queue.py @@ -8,7 +8,7 @@ _logger = logging.getLogger(__name__) class ApacheSolrQueue(models.Model): _name = 'apache.solr.queue' - display_name = fields.Char('Display Name', compute="_compute_display_name", store=True) + display_name = fields.Char('Display Name', compute="_compute_display_name") res_model = fields.Char('Resource Model') res_id = fields.Integer('Resource ID') function_name = fields.Char('Function Name') diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 11558bf4..c45dab25 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -13,6 +13,12 @@ <field name="invoice_date" position="after"> <field name="payment_schedule" attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}"/> </field> + <field name="efaktur_document" position="before"> + <field name="no_faktur_pajak" readonly="1"/> + </field> + <field name="efaktur_document" position="attributes"> + <attribute name="widget">pdf_viewer</attribute> + </field> <field name="invoice_user_id" position="after"> <field name="date_kirim_tukar_faktur"/> <field name="shipper_faktur_id"/> diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 0d972ec1..e0e9ac54 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -48,7 +48,7 @@ <field name="customer_type" attrs="{'required': ['|', ('create_date', '>', '2023-06-28'), ('create_date', '=', False)]}"/> <field name="npwp" placeholder='99.999.999.9-999.999' attrs="{'required': ['|', ('create_date', '>', '2023-06-28'), ('create_date', '=', False)]}"/> <field name="sppkp" attrs="{'invisible': [('customer_type','!=','pkp')], 'required': [('customer_type', '=', 'pkp')]}"/> - <field name="email" attrs="{'required': [('create_date', '>', '2023-09-28')]}"/> + <field name="email" required="1"/> <field name="due_id" readonly="1"/> <field name="source_id" domain="[('id', 'in', [32, 59, 60, 61])]" attrs="{'required':[('create_date', '>', '2023-09-10')]}"/> </field> |
