Skip to content

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

Closed
dreispt wants to merge 1 commit intoOCA:15.0from
ursais:landoo-es-15.0-imp-sets-fields-on-create
Closed

[IMP] purchase_triple_discount: when purchase line created from seller, sets discount2 and discount3#2406
dreispt wants to merge 1 commit intoOCA:15.0from
ursais:landoo-es-15.0-imp-sets-fields-on-create

Conversation

@dreispt
Copy link
Copy Markdown
Member

@dreispt dreispt commented Sep 14, 2024

Co-authored-by: ae-landoo ae@landoo.es
Co-authored-by: legalsylvain sylvain.legal@grap.coop

#1615 rebased to solve issues in earlier merge attempts.

…r, sets discount2 and discount3

Co-authored-by: ae-landoo <ae@landoo.es>
Co-authored-by: legalsylvain <sylvain.legal@grap.coop>
@dreispt
Copy link
Copy Markdown
Member Author

dreispt commented Sep 14, 2024

/ocabot merge patch

@OCA-git-bot
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 8, 2026

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Feb 8, 2026
@github-actions github-actions bot closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants