diff --git a/__manifest__.py b/__manifest__.py index e8956b2..f83c649 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,24 +1,24 @@ -{ - 'name': 'Purchase RFQ Comparison', - 'version': '18.0.1.0.0', - 'category': 'Purchase', - 'summary': 'Add comparison page in RFQ forms with additional fields', - 'description': ''' - This module extends the Purchase RFQ functionality by adding: - - New "To Compare" page in RFQ forms - - Additional fields: Notes, Garansi (warranty), Landed Cost options - - Landed Cost tags with predefined options - - Enhanced Compare Alternative RFQ view with new fields and Payment Terms - ''', - 'author': 'Suherdy Yacob', - 'depends': ['purchase', 'purchase_requisition'], - 'data': [ - 'security/ir.model.access.csv', - 'data/landed_cost_tags_data.xml', - 'views/purchase_order_views.xml', - 'views/purchase_order_alternative_views.xml', - ], - 'installable': True, - 'application': False, - 'license': 'LGPL-3', +{ + 'name': 'Purchase RFQ Comparison', + 'version': '18.0.1.0.0', + 'category': 'Purchase', + 'summary': 'Add comparison page in RFQ forms with additional fields', + 'description': ''' + This module extends the Purchase RFQ functionality by adding: + - New "To Compare" page in RFQ forms + - Additional fields: Notes, Garansi (warranty), Landed Cost options + - Landed Cost tags with predefined options + - Enhanced Compare Alternative RFQ view with new fields and Payment Terms + ''', + 'author': 'Suherdy Yacob', + 'depends': ['purchase', 'purchase_requisition'], + 'data': [ + 'security/ir.model.access.csv', + 'data/landed_cost_tags_data.xml', + 'views/purchase_order_views.xml', + 'views/purchase_order_alternative_views.xml', + ], + 'installable': True, + 'application': False, + 'license': 'LGPL-3', } \ No newline at end of file diff --git a/__pycache__/__init__.cpython-310.pyc b/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..0587393 Binary files /dev/null and b/__pycache__/__init__.cpython-310.pyc differ diff --git a/__pycache__/__init__.cpython-312.pyc b/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..5849f79 Binary files /dev/null and b/__pycache__/__init__.cpython-312.pyc differ diff --git a/data/landed_cost_tags_data.xml b/data/landed_cost_tags_data.xml index ca22496..143b906 100644 --- a/data/landed_cost_tags_data.xml +++ b/data/landed_cost_tags_data.xml @@ -1,37 +1,37 @@ - - - - - - - Biaya Ongkir - ONGKIR - 1 - - - - Biaya Pasang - PASANG - 2 - - - - Biaya Bongkar - BONGKAR - 3 - - - - Biaya Muat - MUAT - 4 - - - - Biaya Dokumen - DOKUMEN - 5 - - - + + + + + + + Biaya Ongkir + ONGKIR + 1 + + + + Biaya Pasang + PASANG + 2 + + + + Biaya Bongkar + BONGKAR + 3 + + + + Biaya Muat + MUAT + 4 + + + + Biaya Dokumen + DOKUMEN + 5 + + + \ No newline at end of file diff --git a/models/__init__.py b/models/__init__.py index 850b7f7..8f047b3 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -1,3 +1,3 @@ -from . import purchase_order -from . import purchase_order_line +from . import purchase_order +from . import purchase_order_line from . import landed_cost_tag \ No newline at end of file diff --git a/models/__pycache__/__init__.cpython-310.pyc b/models/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..17cda4b Binary files /dev/null and b/models/__pycache__/__init__.cpython-310.pyc differ diff --git a/models/__pycache__/__init__.cpython-312.pyc b/models/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..59eecec Binary files /dev/null and b/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/models/__pycache__/landed_cost_tag.cpython-310.pyc b/models/__pycache__/landed_cost_tag.cpython-310.pyc new file mode 100644 index 0000000..811c3cb Binary files /dev/null and b/models/__pycache__/landed_cost_tag.cpython-310.pyc differ diff --git a/models/__pycache__/landed_cost_tag.cpython-312.pyc b/models/__pycache__/landed_cost_tag.cpython-312.pyc new file mode 100644 index 0000000..faff7ad Binary files /dev/null and b/models/__pycache__/landed_cost_tag.cpython-312.pyc differ diff --git a/models/__pycache__/purchase_order.cpython-310.pyc b/models/__pycache__/purchase_order.cpython-310.pyc new file mode 100644 index 0000000..c527cfb Binary files /dev/null and b/models/__pycache__/purchase_order.cpython-310.pyc differ diff --git a/models/__pycache__/purchase_order.cpython-312.pyc b/models/__pycache__/purchase_order.cpython-312.pyc new file mode 100644 index 0000000..432d16d Binary files /dev/null and b/models/__pycache__/purchase_order.cpython-312.pyc differ diff --git a/models/__pycache__/purchase_order_line.cpython-310.pyc b/models/__pycache__/purchase_order_line.cpython-310.pyc new file mode 100644 index 0000000..870c4e5 Binary files /dev/null and b/models/__pycache__/purchase_order_line.cpython-310.pyc differ diff --git a/models/__pycache__/purchase_order_line.cpython-312.pyc b/models/__pycache__/purchase_order_line.cpython-312.pyc new file mode 100644 index 0000000..ccc7786 Binary files /dev/null and b/models/__pycache__/purchase_order_line.cpython-312.pyc differ diff --git a/models/landed_cost_tag.py b/models/landed_cost_tag.py index 527950b..31f551b 100644 --- a/models/landed_cost_tag.py +++ b/models/landed_cost_tag.py @@ -1,12 +1,12 @@ -from odoo import models, fields - - -class LandedCostTag(models.Model): - _name = 'purchase.landed.cost.tag' - _description = 'Landed Cost Tag' - _rec_name = 'name' - - name = fields.Char(string='Name', required=True) - code = fields.Char(string='Code', required=True) - color = fields.Integer(string='Color') +from odoo import models, fields + + +class LandedCostTag(models.Model): + _name = 'purchase.landed.cost.tag' + _description = 'Landed Cost Tag' + _rec_name = 'name' + + name = fields.Char(string='Name', required=True) + code = fields.Char(string='Code', required=True) + color = fields.Integer(string='Color') active = fields.Boolean(string='Active', default=True) \ No newline at end of file diff --git a/models/purchase_order.py b/models/purchase_order.py index 9f20445..a140970 100644 --- a/models/purchase_order.py +++ b/models/purchase_order.py @@ -1,21 +1,21 @@ -from odoo import models, fields, api - - -class PurchaseOrder(models.Model): - _inherit = 'purchase.order' - - # Fields for "To Compare" page - comparison_notes = fields.Text(string='Notes') - garansi = fields.Boolean(string='Garansi') - landed_cost = fields.Boolean(string='Landed Cost') - landed_cost_tag_ids = fields.Many2many( - 'purchase.landed.cost.tag', - string='Landed Cost Tags', - help='Select applicable landed cost types' - ) - - @api.onchange('landed_cost') - def _onchange_landed_cost(self): - """Clear landed cost tags when landed cost is disabled""" - if not self.landed_cost: +from odoo import models, fields, api + + +class PurchaseOrder(models.Model): + _inherit = 'purchase.order' + + # Fields for "To Compare" page + comparison_notes = fields.Text(string='Notes') + garansi = fields.Boolean(string='Garansi') + landed_cost = fields.Boolean(string='Landed Cost') + landed_cost_tag_ids = fields.Many2many( + 'purchase.landed.cost.tag', + string='Landed Cost Tags', + help='Select applicable landed cost types' + ) + + @api.onchange('landed_cost') + def _onchange_landed_cost(self): + """Clear landed cost tags when landed cost is disabled""" + if not self.landed_cost: self.landed_cost_tag_ids = [(5, 0, 0)] # Remove all tags \ No newline at end of file diff --git a/models/purchase_order_line.py b/models/purchase_order_line.py index 80c1aa6..47b28e8 100644 --- a/models/purchase_order_line.py +++ b/models/purchase_order_line.py @@ -1,56 +1,56 @@ -from odoo import models, fields, api - - -class PurchaseOrderLine(models.Model): - _inherit = 'purchase.order.line' - - # Computed fields for comparison data from purchase.order - order_payment_term_id = fields.Many2one( - 'account.payment.term', - string='Payment Terms', - compute='_compute_order_comparison_fields', - help='Payment terms from the purchase order' - ) - - order_comparison_notes = fields.Text( - string='Notes', - compute='_compute_order_comparison_fields', - help='Comparison notes from the purchase order' - ) - - order_garansi = fields.Boolean( - string='Garansi', - compute='_compute_order_comparison_fields', - help='Warranty information from the purchase order' - ) - - order_landed_cost = fields.Boolean( - string='Landed Cost', - compute='_compute_order_comparison_fields', - help='Landed cost flag from the purchase order' - ) - - order_landed_cost_tag_ids = fields.Many2many( - 'purchase.landed.cost.tag', - string='LC Tags', - compute='_compute_order_comparison_fields', - help='Landed cost tags from the purchase order' - ) - - @api.depends('order_id', 'order_id.payment_term_id', 'order_id.comparison_notes', - 'order_id.garansi', 'order_id.landed_cost', 'order_id.landed_cost_tag_ids') - def _compute_order_comparison_fields(self): - """Compute comparison fields from the related purchase order""" - for line in self: - if line.order_id: - line.order_payment_term_id = line.order_id.payment_term_id - line.order_comparison_notes = line.order_id.comparison_notes - line.order_garansi = line.order_id.garansi - line.order_landed_cost = line.order_id.landed_cost - line.order_landed_cost_tag_ids = line.order_id.landed_cost_tag_ids - else: - line.order_payment_term_id = False - line.order_comparison_notes = False - line.order_garansi = False - line.order_landed_cost = False +from odoo import models, fields, api + + +class PurchaseOrderLine(models.Model): + _inherit = 'purchase.order.line' + + # Computed fields for comparison data from purchase.order + order_payment_term_id = fields.Many2one( + 'account.payment.term', + string='Payment Terms', + compute='_compute_order_comparison_fields', + help='Payment terms from the purchase order' + ) + + order_comparison_notes = fields.Text( + string='Notes', + compute='_compute_order_comparison_fields', + help='Comparison notes from the purchase order' + ) + + order_garansi = fields.Boolean( + string='Garansi', + compute='_compute_order_comparison_fields', + help='Warranty information from the purchase order' + ) + + order_landed_cost = fields.Boolean( + string='Landed Cost', + compute='_compute_order_comparison_fields', + help='Landed cost flag from the purchase order' + ) + + order_landed_cost_tag_ids = fields.Many2many( + 'purchase.landed.cost.tag', + string='LC Tags', + compute='_compute_order_comparison_fields', + help='Landed cost tags from the purchase order' + ) + + @api.depends('order_id', 'order_id.payment_term_id', 'order_id.comparison_notes', + 'order_id.garansi', 'order_id.landed_cost', 'order_id.landed_cost_tag_ids') + def _compute_order_comparison_fields(self): + """Compute comparison fields from the related purchase order""" + for line in self: + if line.order_id: + line.order_payment_term_id = line.order_id.payment_term_id + line.order_comparison_notes = line.order_id.comparison_notes + line.order_garansi = line.order_id.garansi + line.order_landed_cost = line.order_id.landed_cost + line.order_landed_cost_tag_ids = line.order_id.landed_cost_tag_ids + else: + line.order_payment_term_id = False + line.order_comparison_notes = False + line.order_garansi = False + line.order_landed_cost = False line.order_landed_cost_tag_ids = False \ No newline at end of file diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index 873aa25..377e056 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -1,3 +1,3 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_purchase_landed_cost_tag_user,purchase.landed.cost.tag.user,model_purchase_landed_cost_tag,purchase.group_purchase_user,1,1,1,0 +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_purchase_landed_cost_tag_user,purchase.landed.cost.tag.user,model_purchase_landed_cost_tag,purchase.group_purchase_user,1,1,1,0 access_purchase_landed_cost_tag_manager,purchase.landed.cost.tag.manager,model_purchase_landed_cost_tag,purchase.group_purchase_manager,1,1,1,1 \ No newline at end of file diff --git a/views/purchase_order_alternative_views.xml b/views/purchase_order_alternative_views.xml index 2abd431..58a6ced 100644 --- a/views/purchase_order_alternative_views.xml +++ b/views/purchase_order_alternative_views.xml @@ -1,35 +1,35 @@ - - - - - purchase.order.alternative.list.inherit.comparison - purchase.order - - - - - - - - - - - - - - - purchase.order.line.compare.list.inherit.comparison - purchase.order.line - - - - - - - - - - - - + + + + + purchase.order.alternative.list.inherit.comparison + purchase.order + + + + + + + + + + + + + + + purchase.order.line.compare.list.inherit.comparison + purchase.order.line + + + + + + + + + + + + \ No newline at end of file diff --git a/views/purchase_order_views.xml b/views/purchase_order_views.xml index 4c963d4..7f31599 100644 --- a/views/purchase_order_views.xml +++ b/views/purchase_order_views.xml @@ -1,83 +1,83 @@ - - - - - purchase.order.form.inherit.comparison - purchase.order - - - - - - - - - - - - - - - - - - - - purchase.landed.cost.tag.list - purchase.landed.cost.tag - - - - - - - - - - - - purchase.landed.cost.tag.form - purchase.landed.cost.tag - -
- - - - - - - - -
-
-
- - - - Landed Cost Tags - purchase.landed.cost.tag - list,form - -

- Create your first landed cost tag! -

-

- Landed cost tags help categorize different types of additional costs - like shipping, installation, loading, unloading, or documentation fees. -

-
-
- - - - + + + + + purchase.order.form.inherit.comparison + purchase.order + + + + + + + + + + + + + + + + + + + + purchase.landed.cost.tag.list + purchase.landed.cost.tag + + + + + + + + + + + + purchase.landed.cost.tag.form + purchase.landed.cost.tag + +
+ + + + + + + + +
+
+
+ + + + Landed Cost Tags + purchase.landed.cost.tag + list,form + +

+ Create your first landed cost tag! +

+

+ Landed cost tags help categorize different types of additional costs + like shipping, installation, loading, unloading, or documentation fees. +

+
+
+ + + +
\ No newline at end of file