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

[14.0][ADD]deltatech product tracking #262

Open
wants to merge 21 commits into
base: 14.0
Choose a base branch
from

Conversation

dhongu
Copy link
Owner

@dhongu dhongu commented Jul 26, 2021

No description provided.

@dhongu dhongu requested a review from feketemihai July 26, 2021 13:00
@danila12
Copy link
Collaborator

danila12 commented Jul 27, 2021

Atentie, daca se schimba in template-ul de produs trasabilitatea, nu intra prin functia write din varianta.

@feketemihai
Copy link
Collaborator

Putem face si asta destul de repede?

_inherit = "product.template"

def write(self, vals):
res = super(ProductTemplate, self).write(vals)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ar trebui sa filtram template si product inainte si sa rulam doar pentru alea, nu pentru toate:

def write(self, vals):
    templates_without_lot = self.filtered(lambda p: p.tracking == "none")
    res = super(ProductTemplate, self).write(vals)
    if templates_without_lot and vals.get("tracking", "none") == "lot":
        templates_without_lot.mapped("product_variant_ids").fill_lot_in_stock_docs()
    return res

@@ -17,61 +30,63 @@ def onchange_tracking(self):
def write(self, vals):
Copy link
Collaborator

Choose a reason for hiding this comment

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

la fel si aici:
def write(self, vals):
products_without_lot = self.filtered(lambda p: p.tracking == "none")
res = super(ProductProduct, self).write(vals)
if products_without_lot and vals.get("tracking", "none") == "lot":
products_without_lot.fill_lot_in_stock_docs()
return res

domain = [("lot_id", "=", False)] + domain
st_move_lines = self.env["stock.move.line"].search(domain)
def fill_lot_in_stock_docs(self):
warehouses = self.env["stock.warehouse"].with_context(active_test=False).search([])
Copy link
Collaborator

Choose a reason for hiding this comment

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

gasim o varinate pe history, sa actualizam si quant-uri di nalte locatii, adica daca avem transfer prin transit, si quant-urile sunt in tranzit in momentul asta...

@danila12
Copy link
Collaborator

Pare ok.

@dhongu dhongu requested a review from feketemihai August 9, 2021 04:44
@dhongu dhongu requested a review from danila12 November 19, 2021 08:54
@dhongu
Copy link
Owner Author

dhongu commented Nov 19, 2021

@feketemihai ce mai trebuie aici ?

@feketemihai
Copy link
Collaborator

feketemihai commented Nov 19, 2021 via email

@dhongu dhongu added the WIP label Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants