summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-06-04 15:39:31 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-06-04 15:39:31 +0700
commit9306992db370c793e8cab494038b0de5b61b600f (patch)
tree63639632645948f4026d480408866c58340ea7c7
parentd52735b3d1dc570f44ad46cae9f069da03784cff (diff)
add sni and tkdn on product_template
-rw-r--r--indoteknik_api/controllers/api_v1/courier.py2
-rw-r--r--indoteknik_api/models/product_template.py2
-rwxr-xr-xindoteknik_custom/models/product_template.py2
-rwxr-xr-xindoteknik_custom/views/product_template.xml2
4 files changed, 7 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/courier.py b/indoteknik_api/controllers/api_v1/courier.py
index 9b5bfebf..bfaa102e 100644
--- a/indoteknik_api/controllers/api_v1/courier.py
+++ b/indoteknik_api/controllers/api_v1/courier.py
@@ -25,7 +25,7 @@ class Courier(controller.Controller):
'image': base_url + 'api/image/rajaongkir.kurir/image/'+str(courier.id)
})
return self.response(data)
-
+
@http.route(prefix + 'def_cargo', auth='public', methods=['GET', 'OPTIONS'])
@controller.Controller.must_authorized()
def get_location_def_cargo(self, **kw):
diff --git a/indoteknik_api/models/product_template.py b/indoteknik_api/models/product_template.py
index fb77769f..75899624 100644
--- a/indoteknik_api/models/product_template.py
+++ b/indoteknik_api/models/product_template.py
@@ -57,6 +57,8 @@ class ProductTemplate(models.Model):
'image': self.env['ir.attachment'].api_image('product.template', 'image_128', product_template.id),
'code': product_template.default_code or '',
'name': product_template.name,
+ 'sni': product_template.sni,
+ 'tkdn': product_template.tkdn,
'variant_total': len(product_template.product_variant_ids),
'stock_total': product_template.qty_stock_vendor,
'weight': product_template.weight,
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index 97ad07a7..6086a2ca 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -57,6 +57,8 @@ class ProductTemplate(models.Model):
('sp', 'Spare Part'),
('acc', 'Accessories')
], string='Kind of', copy=False)
+ sni = fields.Boolean(string='SNI')
+ tkdn = fields.Boolean(string='TKDN')
def _get_qty_sold(self):
for rec in self:
diff --git a/indoteknik_custom/views/product_template.xml b/indoteknik_custom/views/product_template.xml
index 309cbcc5..052a1eba 100755
--- a/indoteknik_custom/views/product_template.xml
+++ b/indoteknik_custom/views/product_template.xml
@@ -12,6 +12,8 @@
<field name="x_model_product"/>
<field name="kind_of"/>
<field name="x_studio_field_tGhJR" widget="many2many_tags"/>
+ <field name="sni"/>
+ <field name="tkdn"/>
</field>
<field name="uom_po_id" position="after">
<field name="unpublished" />