diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-06-23 09:19:22 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-06-23 09:19:22 +0000 |
| commit | 48bf536f0728a07a5f7ad960c7872415957d8e7a (patch) | |
| tree | a74a017b951aba6de4fc102cd1e5355efb7d64d8 | |
| parent | 046aebc189673851511f90f6291790e652b2cc74 (diff) | |
| parent | 24e439fdb72533981200443a52bab82de7f2a739 (diff) | |
Merged in feature/carrier-so-sync-do (pull request #36)
carrier so sync do
| -rwxr-xr-x | indoteknik_custom/models/__init__.py | 2 | ||||
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index 9764e0c0..3c6ce46c 100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py @@ -22,9 +22,9 @@ from . import purchase_pricelist from . import res_partner_company_type from . import res_partner from . import res_users +from . import sale_order from . import sale_monitoring_detail from . import sale_monitoring -from . import sale_order from . import sales_outstanding from . import sales_target from . import stock_move diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 0c631761..0a794f6d 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -122,6 +122,16 @@ class SaleOrder(models.Model): line_no += 1 line.line_no = line_no # _logger.info('Calculate PO Line No %s' % line.id) + + def write(self, vals): + res = super(SaleOrder, self).write(vals) + + if 'carrier_id' in vals: + for picking in self.picking_ids: + if picking.state == 'assigned': + picking.carrier_id = self.carrier_id + + return res def calculate_so_status_beginning(self): so_state = ['sale'] |
