summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchasing_job.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-08-14 16:12:14 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-08-14 16:12:14 +0700
commitd47eb069978ce67bce1a19b6c824a53ca3d68801 (patch)
tree2427f680d68c8b136531d392eb36cf4262c7d35b /indoteknik_custom/models/purchasing_job.py
parent2513b765773fca587dbd298e77732d2d005949c8 (diff)
parentd4df708e5195e1c0c3b8e0ad90b7518e5d4d48c2 (diff)
<iman> Merge branch 'production' of https://bitbucket.org/altafixco/indoteknik-addons into feature/tracking-order
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Diffstat (limited to 'indoteknik_custom/models/purchasing_job.py')
-rw-r--r--indoteknik_custom/models/purchasing_job.py33
1 files changed, 19 insertions, 14 deletions
diff --git a/indoteknik_custom/models/purchasing_job.py b/indoteknik_custom/models/purchasing_job.py
index 373e469a..6e4f239d 100644
--- a/indoteknik_custom/models/purchasing_job.py
+++ b/indoteknik_custom/models/purchasing_job.py
@@ -183,6 +183,7 @@ class OutstandingSales(models.Model):
outgoing = fields.Float(string='Outgoing')
brand = fields.Char(string='Brand')
invoice_partner = fields.Char(string='Invoice Partner')
+ sale_order_create_date = fields.Datetime(string='Sale Order Create Date')
def init(self):
tools.drop_view_if_exists(self.env.cr, self._table)
@@ -199,19 +200,23 @@ class OutstandingSales(models.Model):
so.partner_invoice_id,
sp.origin,
rp2.name as salesperson,
- coalesce(pp.default_code, pt.default_code) as item_code, pt.name as product,
- sm.product_uom_qty as outgoing, xm.x_name as brand, rp.name as invoice_partner
- from stock_move sm
- join stock_picking sp on sp.id = sm.picking_id
- join sale_order_line sol on sol.id = sm.sale_line_id
- join sale_order so on so.id = sol.order_id
- join res_partner rp on rp.id = so.partner_invoice_id
- join res_users ru on ru.id = so.user_id
- join res_partner rp2 on rp2.id = ru.partner_id
- join product_product pp on pp.id = sm.product_id
- join product_template pt on pt.id = pp.product_tmpl_id
- left join x_manufactures xm on xm.id = pt.x_manufacture
- where sp.state in ('draft', 'waiting', 'confirmed', 'assigned')
- and sp.name like '%OUT%'
+ coalesce(pp.default_code, pt.default_code) as item_code,
+ pt.name as product,
+ sm.product_uom_qty as outgoing,
+ xm.x_name as brand,
+ rp.name as invoice_partner,
+ so.create_date as sale_order_create_date
+ from stock_move sm
+ join stock_picking sp on sp.id = sm.picking_id
+ join sale_order_line sol on sol.id = sm.sale_line_id
+ join sale_order so on so.id = sol.order_id
+ join res_partner rp on rp.id = so.partner_invoice_id
+ join res_users ru on ru.id = so.user_id
+ join res_partner rp2 on rp2.id = ru.partner_id
+ join product_product pp on pp.id = sm.product_id
+ join product_template pt on pt.id = pp.product_tmpl_id
+ left join x_manufactures xm on xm.id = pt.x_manufacture
+ where sp.state in ('draft', 'waiting', 'confirmed', 'assigned')
+ and sp.name like '%OUT%'
)
""")