diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-04-10 15:17:38 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-04-10 15:17:38 +0700 |
| commit | 6fc4731e24f1e6f105676273695262f5da059faf (patch) | |
| tree | 9c5db7a71da18f0f059d58ccbda3cd790b598993 /indoteknik_custom/models | |
| parent | 539a2bc4e311ebf5ec3ed8b43d4b0fd433ccecbd (diff) | |
add group partner and fix automatic purchase
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/models/res_partner.py | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index 60444b6a..f2e7d9e9 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -45,7 +45,7 @@ class AutomaticPurchase(models.Model): ], order='brand_id') count = brand_id = 0 for product in products_vendors: - if vendor.id == 5571 and (count == 200 or brand_id != product.brand_id.id): + if vendor['partner_id'][0] == 5571 and (count == 200 or brand_id != product.brand_id.id): count = 0 counter_po_number += 1 new_po = self.env['purchase.order'].create([param_header]) diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py index ad88957f..eaf93717 100644 --- a/indoteknik_custom/models/res_partner.py +++ b/indoteknik_custom/models/res_partner.py @@ -1,5 +1,9 @@ from odoo import models, fields +class GroupPartner(models.Model): + _name = 'group.partner' + + name = fields.Char(string='Name') class ResPartner(models.Model): _inherit = 'res.partner' @@ -7,3 +11,5 @@ class ResPartner(models.Model): reference_number = fields.Char(string="Reference Number") company_type_id = fields.Many2one('res.partner.company_type', string='Company Type') custom_pricelist_id = fields.Many2one('product.pricelist', string='Price Matrix') + group_partner_id = fields.Many2one('group.partner', string='Group Partner') + |
