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][IMP] ddmrp_coverage_days: Adapt view to new Stock Buffer view design #255

Merged
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion ddmrp_coverage_days/models/stock_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
class Buffer(models.Model):
_inherit = "stock.buffer"

coverage_days = fields.Float(compute="_compute_coverage_days")
coverage_days = fields.Float(
compute="_compute_coverage_days", string="Days of Coverage"
)

def _compute_coverage_days(self):
for rec in self:
Expand Down
9 changes: 6 additions & 3 deletions ddmrp_coverage_days/views/stock_buffer_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
<field name="model">stock.buffer</field>
<field name="inherit_id" ref="ddmrp.stock_buffer_view_form" />
<field name="arch" type="xml">
<field name="main_supplier_id" position="after">
<field name="coverage_days" string="Days of Coverage" />
</field>
<xpath expr="//div[@name='net_flow_position_percent']" position="after">
<label for="coverage_days" />
<div name="coverage_days">
<field name="coverage_days" class="oe_inline" /> days
</div>
</xpath>
</field>
</record>
<record id="stock_buffer_view_tree" model="ir.ui.view">
Expand Down