Initial commit
This commit is contained in:
29
garazd_product_label_pro/models/res_company.py
Normal file
29
garazd_product_label_pro/models/res_company.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
print_label_preview_type = fields.Selection(
|
||||
selection=[('demo_product', 'Demo Product'), ('real_product', 'Real Product')],
|
||||
default='demo_product',
|
||||
required=True,
|
||||
help='Specify what product should be used during label designing.',
|
||||
)
|
||||
print_label_preview_product_id = fields.Many2one(
|
||||
comodel_name='product.product',
|
||||
string='Demo Product',
|
||||
default=lambda self: self.env['product.product'].search([
|
||||
('barcode', '!=', False)
|
||||
], limit=1),
|
||||
)
|
||||
print_label_preview_pricelist_id = fields.Many2one(
|
||||
comodel_name='product.pricelist',
|
||||
string='Demo Pricelist',
|
||||
default=lambda self: self.env['product.pricelist'].search([])[:1],
|
||||
)
|
||||
print_label_preview_sale_pricelist_id = fields.Many2one(
|
||||
comodel_name='product.pricelist',
|
||||
string='Demo Promo Pricelist',
|
||||
default=lambda self: self.env['product.pricelist'].search([])[1:2],
|
||||
)
|
||||
Reference in New Issue
Block a user