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

[15.0][FIX] ddmrp: adu field needs to be explicity written when adu_fixed is set #212

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ddmrp/models/stock_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,10 +1147,6 @@ def _search_distributed_source_location_qty(self, operator, value):
)
return [("id", "in", buffers.ids)]

@api.onchange("adu_fixed", "adu_calculation_method")
def onchange_adu(self):
self._calc_adu()

def _search_open_stock_moves_domain(self):
self.ensure_one()
return [
Expand Down Expand Up @@ -1533,6 +1529,8 @@ def _calc_execution_priority(self):
@api.model_create_multi
def create(self, vals_list):
records = super().create(vals_list)
if not self.env.context.get("skip_adu_calculation", False):
records._calc_adu()
records._calc_distributed_source_location()
return records

Expand Down