Skip to content
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

Open
wants to merge 2 commits into
base: 17.0
Choose a base branch
from

Conversation

Murtaza-OSI
Copy link

No description provided.

Copy link
Contributor

@legalsylvain legalsylvain left a 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"
Copy link
Contributor

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)

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"
Copy link
Contributor

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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants