Skip to content

Commit

Permalink
Merge branch '15.0' into 15.0-valuation
Browse files Browse the repository at this point in the history
  • Loading branch information
dhongu authored Jan 5, 2024
2 parents d36fd09 + ee789f8 commit 4df077f
Show file tree
Hide file tree
Showing 21 changed files with 129 additions and 36 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ addon | version | maintainers | summary | price
[deltatech_fleet_geo](deltatech_fleet_geo/) | 15.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Fleet Geographical Information | Free
[deltatech_followup](deltatech_followup/) | 15.0.0.0.4 | | Simple invoice followup, with automatic e-mails | Free
[deltatech_generic_partner_restriction](deltatech_generic_partner_restriction/) | 15.0.2.0.0 | [![cojocariudaniel1](https://github.com/cojocariudaniel1.png?size=30px)](https://github.com/cojocariudaniel1) | Generic Partner restriction | Free
[deltatech_invoice_color](deltatech_invoice_color/) | 15.0.0.0.0 | [![VoicuStefan2001](https://github.com/VoicuStefan2001.png?size=30px)](https://github.com/VoicuStefan2001) | Colors Invoice Lines | Free
[deltatech_invoice_color](deltatech_invoice_color/) | 15.0.0.0.1 | [![VoicuStefan2001](https://github.com/VoicuStefan2001.png?size=30px)](https://github.com/VoicuStefan2001) | Colors Invoice Lines | Free
[deltatech_invoice_delivery](deltatech_invoice_delivery/) | 15.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Create delivery form invoice | Free
[deltatech_invoice_number](deltatech_invoice_number/) | 15.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Renumbering invoice | Free
[deltatech_invoice_payment](deltatech_invoice_payment/) | 15.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Show payments from invoice | Free
[deltatech_invoice_picking](deltatech_invoice_picking/) | 15.0.1.0.9 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Facturare livrari | 5.0 EUR
[deltatech_invoice_product_filter](deltatech_invoice_product_filter/) | 15.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Searching invoice using product | Free
[deltatech_invoice_receipt](deltatech_invoice_receipt/) | 15.0.2.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Create receipt form invoice | Free
[deltatech_invoice_receipt](deltatech_invoice_receipt/) | 15.0.2.0.1 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Create receipt form invoice | Free
[deltatech_invoice_report](deltatech_invoice_report/) | 15.0.1.0.4 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Invoice Report | Free
[deltatech_invoice_to_draft](deltatech_invoice_to_draft/) | 15.0.2.0.1 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Restricted access to reset account move to draft | Free
[deltatech_invoice_weight](deltatech_invoice_weight/) | 15.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Invoice Weight | Free
Expand Down Expand Up @@ -108,7 +108,7 @@ addon | version | maintainers | summary | price
[deltatech_purchase_stock](deltatech_purchase_stock/) | 15.0.1.0.2 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Purchase Stock | Free
[deltatech_purchase_xls](deltatech_purchase_xls/) | 15.0.1.0.6 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Import/export purchase line from/to Excel | Free
[deltatech_ral](deltatech_ral/) | 15.0.1.0.0 | | RAL | Free
[deltatech_reception_note](deltatech_reception_note/) | 15.0.0.0.7 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Batch reception note | Free
[deltatech_reception_note](deltatech_reception_note/) | 15.0.0.0.8 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Batch reception note | Free
[deltatech_replenish](deltatech_replenish/) | 15.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Deltatech Replenish | Free
[deltatech_report_packaging](deltatech_report_packaging/) | 15.0.1.0.1 | [![cojocariudaniel1](https://github.com/cojocariudaniel1.png?size=30px)](https://github.com/cojocariudaniel1) [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Report Packaging | Free
[deltatech_report_prn](deltatech_report_prn/) | 15.0.1.0.3 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Raport PRN | Free
Expand Down Expand Up @@ -157,7 +157,7 @@ addon | version | maintainers | summary | price
[deltatech_stock_reseller](deltatech_stock_reseller/) | 15.0.1.0.1 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Report report reseller | Free
[deltatech_stock_sn](deltatech_stock_sn/) | 15.0.1.0.0 | | Stock Serial Number | Free
[deltatech_stock_valuation](deltatech_stock_valuation/) | 15.0.0.0.1 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Product Stock Valuation | Free
[deltatech_test_system](deltatech_test_system/) | 15.0.0.0.2 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Utils | Free
[deltatech_test_system](deltatech_test_system/) | 15.0.0.0.3 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Utils | Free
[deltatech_tracking_2performant](deltatech_tracking_2performant/) | 15.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | 2Performant tracking | Free
[deltatech_utils](deltatech_utils/) | 15.0.1.0.2 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Utils | Free
[deltatech_vendor_stock](deltatech_vendor_stock/) | 15.0.1.0.5 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Vendor stock availability | Free
Expand Down
2 changes: 1 addition & 1 deletion deltatech_invoice_color/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deltatech Invoice Color
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a20edb30e65822ff892540d57d23ff9e0a34c4c94b0690281db70ec25c0829c2
!! source digest: sha256:c2c9de7cc12b16aa14f3ef419580810fc51d94e92fa92982d5f51e98baf54205
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion deltatech_invoice_color/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Deltatech Invoice Color",
"summary": "Colors Invoice Lines",
"version": "15.0.0.0.0",
"version": "15.0.0.0.1",
"author": "Terrabit, Voicu Stefan",
"license": "OPL-1",
"website": "https://www.terrabit.ro",
Expand Down
29 changes: 18 additions & 11 deletions deltatech_invoice_color/models/account_invoice_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@


class AccountMoveLine(models.Model):
"""Override AccountInvoice_line to add the link to the purchase order line it is related to"""

_inherit = "account.move.line"

color_trigger = fields.Boolean(string="Trigger", compute="_compute_color_trigger")
color_trigger = fields.Selection(
[("danger", "Danger"), ("warning", "Warning")], string="Trigger", compute="_compute_color_trigger"
)

@api.depends("purchase_line_id", "sale_line_ids")
def _compute_color_trigger(self):
for line in self:
if (
line.purchase_line_id
and line.move_id.move_type == "in_invoice"
or line.sale_line_ids
and line.move_id.move_type == "out_invoice"
):
line.color_trigger = True
color_trigger = False
if line.move_id.move_type not in ("in_invoice", "in_refund", "out_invoice", "out_refund"):
line.color_trigger = color_trigger
continue
if not line.product_id:
color_trigger = "warning"
else:
line.color_trigger = False
if line.product_id.type == "product":
if line.move_id.move_type in ("in_invoice", "in_refund"):
if not line.purchase_line_id:
color_trigger = "danger"
else:
if not line.sale_line_ids:
color_trigger = "danger"

line.color_trigger = color_trigger
2 changes: 1 addition & 1 deletion deltatech_invoice_color/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Deltatech Invoice Color</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a20edb30e65822ff892540d57d23ff9e0a34c4c94b0690281db70ec25c0829c2
!! source digest: sha256:c2c9de7cc12b16aa14f3ef419580810fc51d94e92fa92982d5f51e98baf54205
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="https://www.odoo.com/documentation/master/legal/licenses.html"><img alt="License: OPL-1" src="https://img.shields.io/badge/licence-OPL--1-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/dhongu/deltatech/tree/15.0/deltatech_invoice_color"><img alt="dhongu/deltatech" src="https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github" /></a></p>
<dl class="docutils">
Expand Down
4 changes: 2 additions & 2 deletions deltatech_invoice_color/views/account_invoice_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<field name="color_trigger" invisible="1" />
</xpath>
<xpath expr="//field[@name='invoice_line_ids']/tree" position="attributes">
<attribute name="decoration-danger">not color_trigger</attribute>
<attribute name="decoration-warning">not product_id</attribute>
<attribute name="decoration-danger">color_trigger == 'danger'</attribute>
<attribute name="decoration-warning">color_trigger == 'warning'</attribute>
</xpath>
</field>
</record>
Expand Down
2 changes: 1 addition & 1 deletion deltatech_invoice_receipt/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deltatech Invoice Receipt
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e3c7b260d52ace66ba28d69ea29ce037b829a93c9ae36e36e95a3fc5bd7c118b
!! source digest: sha256:959a1d144ec9d526ca617b266736c456ae39c4d0d6cfadfc80cc832bd4aadecd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
Expand Down
3 changes: 2 additions & 1 deletion deltatech_invoice_receipt/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"name": "Deltatech Invoice Receipt",
"summary": "Create receipt form invoice",
"version": "15.0.2.0.0",
"version": "15.0.2.0.1",
"author": "Terrabit, Dorin Hongu",
"license": "OPL-1",
"website": "https://www.terrabit.ro",
Expand All @@ -15,6 +15,7 @@
"data": [
# 'account_invoice_view.xml'
# 'views/invoice_view.xml'
"views/account_move_view.xml"
],
"images": ["static/description/main_screenshot.png"],
"development_status": "Mature",
Expand Down
30 changes: 24 additions & 6 deletions deltatech_invoice_receipt/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,21 @@ def action_post(self):
purchase_invoices = self.filtered(lambda inv: inv.move_type == "in_invoice")
if purchase_invoices:
purchase_invoices.add_to_purchase()
purchase_invoices.receipt_to_stock()
purchase_orders = self.get_purchase_from_invoice()
# verific daca comanda de achizitie este confirmata
if purchase_orders.filtered(lambda order: order.state not in ["purchase", "done"]):
return {
"type": "ir.actions.client",
"tag": "display_notification",
"params": {
"title": "Confirm purchase order",
"message": "Please confirm purchase order before posting invoice",
"sticky": True,
"next": {"type": "ir.actions.act_window_close"},
},
}

purchase_orders.receipt_to_stock()
return super().action_post()

def add_to_purchase(self):
Expand All @@ -28,6 +42,11 @@ def add_to_purchase(self):
"""

for invoice in self:
if invoice.state != "draft":
continue
if invoice.move_type not in ["in_invoice", "in_refund"]:
continue

if not invoice.invoice_date:
raise UserError(_("Please enter invoice date"))
# exista o comanda de achizitie legata de aceasta factura ?
Expand Down Expand Up @@ -78,7 +97,7 @@ def add_to_purchase(self):
)
if purchase_order.from_invoice_id:
# am eliminat contextul pentru ca se timitea move_type in procurement.group
purchase_order.with_context({}).button_confirm() # confirma comanda de achizitie
# purchase_order.with_context({}).button_confirm() # confirma comanda de achizitie
purchase_order.message_post_with_view(
"mail.message_origin_link",
values={"self": purchase_order, "origin": invoice},
Expand All @@ -94,11 +113,10 @@ def add_to_purchase(self):
message = _("The purchase order %s was generated.") % link
invoice.message_post(body=message)

def receipt_to_stock(self):
def get_purchase_from_invoice(self):
purchase_orders = self.env["purchase.order"]
for invoice in self:
# trebuie sa determin care este cantitatea care trebuie sa fie receptionata
for line in invoice.invoice_line_ids:
purchase_orders |= line.purchase_line_id.order_id
# doar pentru comenzile generate din factura se face receptia
purchase_orders.filtered(lambda order: order.from_invoice_id).receipt_to_stock()

return purchase_orders.filtered(lambda order: order.from_invoice_id)
2 changes: 1 addition & 1 deletion deltatech_invoice_receipt/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Deltatech Invoice Receipt</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e3c7b260d52ace66ba28d69ea29ce037b829a93c9ae36e36e95a3fc5bd7c118b
!! source digest: sha256:959a1d144ec9d526ca617b266736c456ae39c4d0d6cfadfc80cc832bd4aadecd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="https://www.odoo.com/documentation/master/legal/licenses.html"><img alt="License: OPL-1" src="https://img.shields.io/badge/licence-OPL--1-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/dhongu/deltatech/tree/15.0/deltatech_invoice_receipt"><img alt="dhongu/deltatech" src="https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github" /></a></p>
<dl class="docutils">
Expand Down
11 changes: 11 additions & 0 deletions deltatech_invoice_receipt/views/account_move_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="action_add_to_purchase" model="ir.actions.server">
<field name="name">Add to purchase order</field>
<field name="model_id" ref="model_account_move" />
<field name="binding_model_id" ref="account.model_account_move" />
<field name="binding_view_types">form</field>
<field name="state">code</field>
<field name="code">action = record.add_to_purchase()</field>
</record>
</odoo>
2 changes: 1 addition & 1 deletion deltatech_reception_note/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deltatech reception_note
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:aa061ee1fa81214fc3d2d4636996848b45ac1aad642d95eeff3830cc7e128810
!! source digest: sha256:a399d3dfb7730d0f50ccbadf809fd37ab782b733046b389bb65966795f0a67c1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion deltatech_reception_note/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Deltatech reception_note",
"summary": "Batch reception note",
"version": "15.0.0.0.7",
"version": "15.0.0.0.8",
"author": "Terrabit, Dan Stoica",
"website": "https://www.terrabit.ro",
"support": "odoo@terrabit.ro",
Expand Down
2 changes: 1 addition & 1 deletion deltatech_reception_note/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def reduce_from_rfq(self):
for line in self.order_line:
quality = line.product_qty
domain = [("order_id", "in", rfq_orders.ids), ("product_id", "=", line.product_id.id)]
rfq_lines = self.env["purchase.order.line"].search(domain)
rfq_lines = self.env["purchase.order.line"].search(domain, order="date_order")
if not rfq_lines:
raise UserError(
_("The %s product (%s) is not found in a rfq")
Expand Down
2 changes: 1 addition & 1 deletion deltatech_reception_note/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Deltatech reception_note</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:aa061ee1fa81214fc3d2d4636996848b45ac1aad642d95eeff3830cc7e128810
!! source digest: sha256:a399d3dfb7730d0f50ccbadf809fd37ab782b733046b389bb65966795f0a67c1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/dhongu/deltatech/tree/15.0/deltatech_reception_note"><img alt="dhongu/deltatech" src="https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github" /></a></p>
<p>Features:</p>
Expand Down
2 changes: 1 addition & 1 deletion deltatech_test_system/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deltatech Test System
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:48a6b7f44ba257dce6465b56999fc75bc7336abd7236851c0b421d5f420ecd72
!! source digest: sha256:241aedbc2ed51df01055f1db54e36ce2ec3336e1053fa5775da1e32f8f651c3f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
Expand Down
3 changes: 2 additions & 1 deletion deltatech_test_system/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"name": "Deltatech Test System",
"summary": "Utils",
"version": "15.0.0.0.2",
"version": "15.0.0.0.3",
"author": "Terrabit, Dorin Hongu",
"website": "https://www.terrabit.ro",
"category": "Tools",
Expand All @@ -16,4 +16,5 @@
"images": ["static/description/main_screenshot.png"],
"development_status": "Production/Stable",
"maintainers": ["dhongu"],
"auto_install": False,
}
Loading

0 comments on commit 4df077f

Please sign in to comment.