Skip to content

Commit

Permalink
[MIG] sale_order_priority: migrate to V17
Browse files Browse the repository at this point in the history
  • Loading branch information
astirpe committed Jul 10, 2024
1 parent 7342837 commit 57b4f94
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions sale_order_priority/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ Contributors

- Simone Rubino <[email protected]>
- George Daramouskas <[email protected]>
- ``360ERP <https://www.360erp.com>``:

- Andrea Stirpe

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion sale_order_priority/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Sale Order Priority",
"summary": "Define priority on sale orders",
"version": "15.0.1.0.1",
"version": "17.0.1.0.0",
"category": "Sale Workflow",
"website": "https://github.com/OCA/sale-workflow",
"author": "Agile Business Group, Odoo Community Association (OCA)",
Expand Down
5 changes: 3 additions & 2 deletions sale_order_priority/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class SaleOrder(models.Model):
store=True,
index=True,
tracking=True,
states={"done": [("readonly", True)], "cancel": [("readonly", True)]},
help="Priority for this sale order. "
"Setting manually a value here would set it as priority "
"for all the order lines",
Expand All @@ -37,7 +36,9 @@ def _compute_priority(self):
def _inverse_priority(self):
for order in self:
priority = order.priority
for line in order.order_line.filtered(lambda x: x.priority != priority):
for line in order.order_line.filtered(
lambda x, pr=priority: x.priority != pr
):
line.priority = priority

def action_confirm(self):
Expand Down
2 changes: 2 additions & 0 deletions sale_order_priority/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
- Simone Rubino \<<[email protected]>\>
- George Daramouskas \<<[email protected]>\>
- `360ERP <https://www.360erp.com>`:
- Andrea Stirpe
4 changes: 4 additions & 0 deletions sale_order_priority/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li>Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;agilebg.com">simone.rubino&#64;agilebg.com</a>&gt;</li>
<li>George Daramouskas &lt;<a class="reference external" href="mailto:gdaramouskas&#64;therp.nl">gdaramouskas&#64;therp.nl</a>&gt;</li>
<li><tt class="docutils literal">360ERP <span class="pre">&lt;https://www.360erp.com&gt;</span></tt>:<ul>
<li>Andrea Stirpe</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
2 changes: 1 addition & 1 deletion sale_order_priority/views/sale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<group name="sales_person" position="inside">
<field name="priority" />
<field name="priority" readonly="state == 'cancel' or locked" />
</group>
<xpath
expr="//field[@name='order_line']//form//field[@name='price_unit']"
Expand Down

0 comments on commit 57b4f94

Please sign in to comment.