diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2024-08-14 13:31:36 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2024-08-14 13:31:36 +0700 |
| commit | ed089761d43b20ecc4190ca9d88a0bdb769d81f2 (patch) | |
| tree | 6f5ed6967a4aa20e5773561f7a6b129d91b23311 /indoteknik_custom/models/purchasing_job.py | |
| parent | 513d2b473f4fbf7245c35289e2a3215c5da556a6 (diff) | |
| parent | c091a99de4e3c3bb4f85a8b0c91d75735ebefbd4 (diff) | |
Merge branch 'production' into feature/calculate_selling_price
# Conflicts:
# indoteknik_custom/views/website_user_cart.xml
Diffstat (limited to 'indoteknik_custom/models/purchasing_job.py')
| -rw-r--r-- | indoteknik_custom/models/purchasing_job.py | 33 |
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%' ) """) |
