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

[IMP] purchase_triple_discount: when purchase line created from seller, sets discount2 and discount3 #2406

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from

Conversation

dreispt
Copy link
Member

@dreispt dreispt commented Sep 14, 2024

Co-authored-by: ae-landoo [email protected]
Co-authored-by: legalsylvain [email protected]

#1615 rebased to solve issues in earlier merge attempts.

…r, sets discount2 and discount3

Co-authored-by: ae-landoo <[email protected]>
Co-authored-by: legalsylvain <[email protected]>
@dreispt
Copy link
Member Author

dreispt commented Sep 14, 2024

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 15.0-ocabot-merge-pr-2406-by-dreispt-bump-patch, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Sep 14, 2024
Signed-off-by dreispt
@OCA-git-bot
Copy link
Contributor

@dreispt your merge command was aborted due to failed check(s), which you can inspect on this commit of 15.0-ocabot-merge-pr-2406-by-dreispt-bump-patch.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@StefanRijnhart StefanRijnhart added this to the 15.0 milestone Sep 23, 2024
@StefanRijnhart
Copy link
Member

The error is related to this module

2024-09-14 17:26:43,266 669 ERROR odoo odoo.addons.sale_purchase_force_vendor.tests.test_sale_purchase_force_vendor: ERROR: TestSalePurchaseForceVendor.test_misc
Traceback (most recent call last):
  File "/__w/purchase-workflow/purchase-workflow/sale_purchase_force_vendor/tests/test_sale_purchase_force_vendor.py", line 11, in test_misc
    self.sale_order.action_confirm()
  File "/opt/odoo/addons/sale/models/sale_order.py", line 1003, in action_confirm
    self.with_context(context)._action_confirm()
  File "/opt/odoo/addons/sale_stock/models/sale_order.py", line 149, in _action_confirm
    self.order_line._action_launch_stock_rule()
  File "/opt/odoo/addons/sale_stock/models/sale_order.py", line 607, in _action_launch_stock_rule
    procurement_group.run(procurements)
  File "/opt/odoo/addons/purchase_stock/models/stock.py", line 365, in run
    return super().run(procurements, raise_user_error=raise_user_error)
  File "/opt/odoo-venv/lib/python3.8/site-packages/odoo/addons/stock_procurement_group_hook/hooks.py", line 62, in run_new
    getattr(self.env["stock.rule"], "_run_%s" % action)(procurements)
  File "/opt/odoo/addons/stock/models/stock_rule.py", line 269, in _run_pull
    moves._action_confirm()
  File "/opt/odoo/addons/stock/models/stock_move.py", line 1291, in _action_confirm
    self.env['procurement.group'].run(procurement_requests, raise_user_error=not self.env.context.get('from_orderpoint'))
  File "/opt/odoo/addons/purchase_stock/models/stock.py", line 365, in run
    return super().run(procurements, raise_user_error=raise_user_error)
  File "/opt/odoo-venv/lib/python3.8/site-packages/odoo/addons/stock_procurement_group_hook/hooks.py", line 62, in run_new
    getattr(self.env["stock.rule"], "_run_%s" % action)(procurements)
  File "/__w/purchase-workflow/purchase-workflow/purchase_requisition_grouped_by_procurement/models/stock_rule.py", line 13, in _run_buy
    return super(StockRule, _self)._run_buy(procurements=procurements)
  File "/__w/purchase-workflow/purchase-workflow/purchase_request/models/stock_rule.py", line 92, in _run_buy
    return super(StockRule, self)._run_buy(procurements)
  File "/__w/purchase-workflow/purchase-workflow/purchase_representative/models/stock_rule.py", line 13, in _run_buy
    return super()._run_buy(procurements)
  File "/__w/purchase-workflow/purchase-workflow/procurement_purchase_no_grouping/models/stock_rule.py", line 22, in _run_buy
    return super()._run_buy(procurements)
  File "/__w/purchase-workflow/purchase-workflow/sale_purchase_secondary_unit/models/stock_rule.py", line 28, in _run_buy
    return super(
  File "/opt/odoo/addons/purchase_requisition_stock/models/stock.py", line 25, in _run_buy
    return super(StockRule, self)._run_buy(other_procurements)
  File "/opt/odoo/addons/purchase_stock/models/stock_rule.py", line 155, in _run_buy
    po_line_values.append(self.env['purchase.order.line']._prepare_purchase_order_line_from_procurement(
  File "/__w/purchase-workflow/purchase-workflow/sale_purchase_secondary_unit/models/purchase_order_line.py", line 39, in _prepare_purchase_order_line_from_procurement
    res = super()._prepare_purchase_order_line_from_procurement(
  File "/__w/purchase-workflow/purchase-workflow/purchase_stock_secondary_unit/models/purchase_order_line.py", line 64, in _prepare_purchase_order_line_from_procurement
    res = super()._prepare_purchase_order_line_from_procurement(
  File "/opt/odoo/addons/purchase_stock/models/purchase.py", line 564, in _prepare_purchase_order_line_from_procurement
    res = self._prepare_purchase_order_line(product_id, product_qty, product_uom, company_id, supplier, po)
  File "/__w/purchase-workflow/purchase-workflow/purchase_discount/models/purchase_order.py", line 104, in _prepare_purchase_order_line
    res.update(self._prepare_purchase_order_line_from_seller(seller))
TypeError: 'NoneType' object is not iterable

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.

4 participants