[IMP] product, website_sale: add chatter to pricelist
add chatter to product pricelist to improve collaboration. Track currency, company, country groups, discount policy and website fields. task-3316528 closes odoo/odoo#121244 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
committed by
Victor Feyens
parent
167944cc93
commit
09583d1563
@@ -7,6 +7,7 @@ from odoo.exceptions import UserError
|
||||
|
||||
class Pricelist(models.Model):
|
||||
_name = "product.pricelist"
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
_description = "Pricelist"
|
||||
_rec_names_search = ['name', 'currency_id'] # TODO check if should be removed
|
||||
_order = "sequence asc, id desc"
|
||||
@@ -25,16 +26,22 @@ class Pricelist(models.Model):
|
||||
currency_id = fields.Many2one(
|
||||
comodel_name='res.currency',
|
||||
default=_default_currency_id,
|
||||
required=True)
|
||||
required=True,
|
||||
tracking=1,
|
||||
)
|
||||
|
||||
company_id = fields.Many2one(
|
||||
comodel_name='res.company')
|
||||
comodel_name='res.company',
|
||||
tracking=5,
|
||||
)
|
||||
country_group_ids = fields.Many2many(
|
||||
comodel_name='res.country.group',
|
||||
relation='res_country_group_pricelist_rel',
|
||||
column1='pricelist_id',
|
||||
column2='res_country_group_id',
|
||||
string="Country Groups")
|
||||
string="Country Groups",
|
||||
tracking=10,
|
||||
)
|
||||
|
||||
discount_policy = fields.Selection(
|
||||
selection=[
|
||||
@@ -42,7 +49,9 @@ class Pricelist(models.Model):
|
||||
('without_discount', "Show public price & discount to the customer"),
|
||||
],
|
||||
default='with_discount',
|
||||
required=True)
|
||||
required=True,
|
||||
tracking=15,
|
||||
)
|
||||
|
||||
item_ids = fields.One2many(
|
||||
comodel_name='product.pricelist.item',
|
||||
|
||||
@@ -119,6 +119,11 @@
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="activity_ids"/>
|
||||
<field name="message_follower_ids"/>
|
||||
<field name="message_ids"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -19,7 +19,14 @@ class ProductPricelist(models.Model):
|
||||
domain = [('company_id', '=', company_id)]
|
||||
return self.env['website'].search(domain, limit=1)
|
||||
|
||||
website_id = fields.Many2one('website', string="Website", ondelete='restrict', default=_default_website, domain="[('company_id', '=?', company_id)]")
|
||||
website_id = fields.Many2one(
|
||||
comodel_name='website',
|
||||
string="Website",
|
||||
ondelete='restrict',
|
||||
default=_default_website,
|
||||
domain="[('company_id', '=?', company_id)]",
|
||||
tracking=20,
|
||||
)
|
||||
code = fields.Char(string='E-commerce Promotional Code', groups="base.group_user")
|
||||
selectable = fields.Boolean(help="Allow the end user to choose this price list")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user