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

[16.0][IMP] sale order carrier auto assign multi-company #34

Closed
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
9 changes: 9 additions & 0 deletions sale_order_carrier_auto_assign/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ This module assigns automatically delivery carrier on sale order confirmation.
.. contents::
:local:

Configuration
=============

To enable sale order carrier auto assign:

#. Go to *Settings > Sales > Carrier Auto Assign*.

Bug Tracker
===========

Expand All @@ -64,6 +71,8 @@ Contributors
* Akim Juillerat <[email protected]>
* Son (Ho Dac) <[email protected]>
* Phuc (Tran Thanh) <[email protected]>
* Telmo Santos <[email protected]>
* Tris Doan <[email protected]>
Comment on lines 73 to +75
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you drop changes to README in the PR?


Maintainers
~~~~~~~~~~~
Expand Down
7 changes: 4 additions & 3 deletions sale_order_carrier_auto_assign/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ class SaleOrder(models.Model):
_inherit = "sale.order"

def action_confirm(self):
if not self.env.user.company_id.carrier_auto_assign:
return super().action_confirm()
self._add_delivery_carrier_on_confirmation()
for rec in self:
if not rec.company_id.carrier_auto_assign:
continue
rec._add_delivery_carrier_on_confirmation()
return super().action_confirm()

def _add_delivery_carrier_on_confirmation(self):
Expand Down
1 change: 1 addition & 0 deletions sale_order_carrier_auto_assign/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
* Son (Ho Dac) <[email protected]>
* Phuc (Tran Thanh) <[email protected]>
* Telmo Santos <[email protected]>
* Tris Doan <[email protected]>
Comment on lines 3 to +5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to prevent a conflict with other PR

Suggested change
* Phuc (Tran Thanh) <[email protected]>
* Telmo Santos <[email protected]>
* Tris Doan <[email protected]>
* Tris Doan <[email protected]>
* Phuc (Tran Thanh) <[email protected]>

30 changes: 20 additions & 10 deletions sale_order_carrier_auto_assign/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -379,41 +379,51 @@ <h1 class="title">Sale Order Carrier Auto Assign</h1>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
Comment on lines -382 to +387
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you drop changes to index in the PR ?

</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>To enable sale order carrier auto assign:</p>
<ol class="arabic simple">
<li>Go to <em>Settings &gt; Sales &gt; Carrier Auto Assign</em>.</li>
</ol>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-workflow/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_order_carrier_auto_assign%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Camptocamp</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Akim Juillerat &lt;<a class="reference external" href="mailto:akim.juillerat&#64;camptocamp.com">akim.juillerat&#64;camptocamp.com</a>&gt;</li>
<li>Son (Ho Dac) &lt;<a class="reference external" href="mailto:hodacson.6491&#64;gmail.com">hodacson.6491&#64;gmail.com</a>&gt;</li>
<li>Phuc (Tran Thanh) &lt;<a class="reference external" href="mailto:phuc&#64;trobz.com">phuc&#64;trobz.com</a>&gt;</li>
<li>Telmo Santos &lt;<a class="reference external" href="mailto:telmo.santos&#64;camptocamp.com">telmo.santos&#64;camptocamp.com</a>&gt;</li>
<li>Tris Doan &lt;<a class="reference external" href="mailto:tridm&#64;trobz.com">tridm&#64;trobz.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
Expand Down
Loading