Skip to content

Commit

Permalink
TA#70572 [IMP] stock_orderpoint_scheduled_date (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
majouda authored Oct 31, 2024
1 parent c63abe3 commit 4736e83
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ RUN mkdir -p "${THIRD_PARTY_ADDONS}" && chown -R odoo "${THIRD_PARTY_ADDONS}"
COPY ./gitoo.yml /gitoo.yml
RUN gitoo install-all --conf_file /gitoo.yml --destination "${THIRD_PARTY_ADDONS}"

USER odoo


COPY product_category_safe_change /mnt/extra-addons/product_category_safe_change
COPY product_packaging_dimension_decimal /mnt/extra-addons/product_packaging_dimension_decimal
Expand Down
2 changes: 1 addition & 1 deletion stock_orderpoint_scheduled_date/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Stock Orderpoint Scheduled Date",
"summary": "Force Scheduled Date in Stock Orderpoint",
"version": "14.0.1.0.0",
"version": "14.0.1.1.0",
"category": "stock",
"website": "https://bit.ly/numigi-com",
"author": "Numigi",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ class stockWarehouseOrderpoint(models.Model):
_inherit = "stock.warehouse.orderpoint"

scheduled_date = fields.Date("Scheduled Date")
previous_scheduled_date = fields.Date(
"Previous Scheduled Date", default=fields.Date.today()
)

@api.depends('rule_ids', 'product_id.seller_ids',
'product_id.seller_ids.delay', 'scheduled_date')
def _compute_lead_days(self):
for orderpoint in self.with_context(bypass_delay_description=True):
if not orderpoint.scheduled_date:
return super(stockWarehouseOrderpoint, orderpoint)._compute_lead_days()
else:
if orderpoint.scheduled_date:
orderpoint.lead_days_date = orderpoint.scheduled_date
elif orderpoint.previous_scheduled_date:
orderpoint.lead_days_date = orderpoint.previous_scheduled_date
else:
super(stockWarehouseOrderpoint, orderpoint)._compute_lead_days()

def open_set_schedule_date_wizard(self):
wizard = self.env['stock.warehouse.orderpoint.schedule.date'].create({})
Expand All @@ -28,5 +33,7 @@ def open_set_schedule_date_wizard(self):

def action_replenish(self):
result = super(stockWarehouseOrderpoint, self).action_replenish()
self.write({"scheduled_date": False})
self.write(
{"previous_scheduled_date": self.scheduled_date, "scheduled_date": False}
)
return result
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<field name="arch" type="xml">
<field name="product_uom_name" position="after">
<field name="scheduled_date"/>
<field name="previous_scheduled_date" invisible="1"/>
</field>
</field>
</record>
Expand All @@ -17,6 +18,7 @@
<field name="arch" type="xml">
<field name="qty_multiple" position="after">
<field name="scheduled_date"/>
<field name="previous_scheduled_date" invisible="1"/>
</field>
</field>
</record>
Expand Down

0 comments on commit 4736e83

Please sign in to comment.