-
-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[17.0][ADD] product_identification. #1728
base: 17.0
Are you sure you want to change the base?
Conversation
39850cb
to
4e0c1e1
Compare
4e0c1e1
to
ffb2423
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. Thanks for contributing !
some remarks inline, one blocking.
otherwise, LGTM. I think that maybe this feature is present in OCA, but I don't remember which module...
|
||
|
||
class ProductIdCategory(models.Model): | ||
_name = "product.product.id_category" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
except an historical error in odoo, there is no "_" in model name.
maybe "product.identification.category" is enought. don't you think ? (and product.identification instead of product.product.id_number)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved
_inherit = "product.template" | ||
|
||
id_numbers = fields.One2many( | ||
"product.product.id_number", "product_id", string="Identification Numbers" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't looks consistent.
id_numbers = fields.One2many()
in product.template
but in the other model, it is in product.product
product_id = fields.Many2one("product.product", string="Product")
I think you should choose between product and template.
class ProductTemplate(models.Model): | ||
_inherit = "product.template" | ||
|
||
id_numbers = fields.One2many( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id_numbers = fields.One2many( | |
identification_ids = fields.One2many( |
date_issued = fields.Date() | ||
expiry_date = fields.Date() | ||
place_of_issue = fields.Char(string="Place of Issue") | ||
product_id = fields.Many2one("product.product", string="Product") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
product_id = fields.Many2one("product.product", string="Product") | |
product_id = fields.Many2one("product.product", string="Product", required=True) |
I guess it doesn't make sense to have an inentification without product. Or did i missed something ?
No description provided.